MySQL data insert, UPDATE, delete

Source: Internet
Author: User
(1), Data insertion Insert syntax: INSERT into table name (field name 1, field name 2,n,) VALUES (' Value 1 ', ' Value 2 ', ' Value 3 ') Example: Create TABLE Gonda (user_id int,user_name varchar (), old int,address varchar (50)); Standard data insertion: INSERT INTO Gonda (user_id,user_name,old,address) VALUES (' 111 ', ' Alvin ', ' A ', ' Gongdahanshuiliyuan '); Non-standard data insertion insert into Gonda values (' + ', ' Zhangsan ', ' $ ', ' asdfdfsdf ');  Insert multiple data inserts into Gonda values (' A ', ' Zhangsan ', ' ' max ', ' Asdfdfsdf '), (' 113, ' Lisi ', ' ' "', ' aaaaa '), (' All ', ' Lisi ', ' (' AAAAA '), (' Lisi ', ' aaaaa '), (' 118, ' Lisi ', ' + ', ' aaaaa ');(2), update the data updated Syntax: Update table name set field name 1= value 1, Field name 2= value 2.....where conditional expression (required) Example: Change single value update Gonda set old=500 where user_id=110; change multiple values update Gonda set User_name= ' Glvin ', old= ' where user_id=111; (3), delete data delete syntax: Delete from table name where Condition expression example: Delete from Gonda where user_id=110;


Related Article

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.