MySQL Basic learning-data manipulation

Source: Internet
Author: User

For the operation of the data, there is nothing more than "adding and removing the check" these kinds of operations.

1 increase

The increase in data is inserted using the INSERT statement

Syntax: INSERT into table_name (COLUMN1,COLUMN2,...) VALUES (value1,value2,...)

For example: INSERT into person (name) values (' Lila ');

2 Delete

Delete operation of data, using delete

Syntax: DELETE from table_name WHERE condtion ...

For example: delete from the person where id= ' 1 ';

Note: Delete operation must be conditional, and delete operation must be cautious, accidentally to back pot.

3 update

Data update operation, using the update

Syntax: UPDATE table_name SET column= ' value ' WHERE condition

For example: Update person set name= ' xiaoming ' where id= ' 1 ';

Update statements can also be updated with multiple values

For example: Update person set name= ' xiaoming ', age=12 where id= ' 1 ';

4 Find

Data lookup operations, which are the most frequently used operations, use the Select

Syntax: SELECT column1,column2 from table_name[WHERE condition]

Example: Select name from the person where id= ' 1 '

Common Find operations:

1. Connection Lookup

Use the inner join,left join,right join,out join.

2. Multi-table Lookup

Find more than two tables.

3. Fuzzy Search

Generally use the LIKE keyword and%

4. Nesting lookups

Nested lookups are typically used for conditional filtering lookups.

MySQL Basic learning-data manipulation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.