MySQL Learning notes

Source: Internet
Author: User

MySQL Learning notes  

add:insert Delete: delete change: Update check:Select

Database:

created: Create database name ';

modified:rename database ' database name ' to '

Delete : Drop database name ';

Table:

created: Createtable ' database name ' . ' table name ' (' field 1 ', ' Field 2 ', ' Field 3 ');

modified:rename table ' database name ' . ' old table name ' to ' database name '. ' new table name ' `

Delete:drop table ' name '

Empty:truncate table ' name '

Data:

multiple conditions are connected with and, * on behalf of all ;

add:insert INTO ' table name ' (' field 1 ', ' field 2 ', ' field 3 ') value (' value 1 ', ' value 2 ', ' value 3 '), (' value 1 ', ' value 2 ', ' Value 3 ');

Delete :delete from ' table name ' where ' field ' = condition ;

change:update ' table name ' Set ' field ' = ' new value ' where ' table name '. ' Field ` = conditions ;

Check:select * from ' table name ' where ' field ' = condition ;

Splicing of variables:

variable outside with curly braces ;

Example :$name = ' o ';

$sql = "INSERT INTO ' userinfor ' (' userId ', ' userName ', ' PassWord ', ' Vipgrade ') VALUES (null, ' {$name} ', ' 123456 ', ' 1 ') ";

MySQL Learning notes

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.