Database basic additions and deletions to change
1. Increase - Add / Insert data,insert into
Insert which table, those columns, what values,
statement:INSERT into table name (column 1, column 2, column 3)values ( value 1, value 2, value 3);
Can not be inserted in the order of the original column, you can also insert some columns, but the values and columns to correspond, not chaos!!!
inserting multiple rows of data at once :
i 1 2 " values ( 1 2) ( 1 2)
2. Change - updating data update
Update which table, which columns, which values
statement: update set column 1= 1 2= 2 3= 3 where
3. Check - Query data Select
query all columns of the table: S elect * from table name;
Query Section column : Select column 1, column 2 from table name where condition;
4. Delete - Deleting data Delete
D elete from table name where condition;
Modify table structure (alter Modify)
1. Modify Table name
R ENAME table name to new table name;
A lter table name rename to new table name;
2. Adding Columns
A lter table name The definition of the Add column list;
3. Modify the definition/properties of a column
A lter table name modify column name new definition;
4. Modify the order of columns
A lter table name modify column 1 definition 1 after column 2 ;
5. Modify column names
A lter table name change old column name new column name new definition;
6. Delete Column
A lter table name drop column name;
This article is from the "It Rookie Learning daily" blog, please be sure to keep this source http://huanrong.blog.51cto.com/12879628/1931825
MySQL Notes-database basic additions and deletions change table structure