1. Create a table
CREATE TABLE Table name (
The type of column names,
The type of column names,
Type of column name (note that the last column cannot be added ' ,')
);
2. Modify the table
Modify table Name--"Rename old table name to new table name;
Add column--"ALTER TABLE name Add (type of column list);
Modify column--"ALTER TABLE name modify (Type of column list);
Delete Column--"ALTER TABLE name drop (column name);
3. Display table structure
DESC table name;
4. Inserting data into the table
Insert Data-"INSERT into table name (column name, column name, column name) values (data, data, data); Note that data inserted in addition to numbers must be enclosed in single quotes '
Insert date data--"Eg:insert into EMP (birth) VALUES (' 2014-08-04 ', ' yyyy-mm-dd ');
5. Change the data in the table
Updated data (update)--"eg:update emp set salay=6500,job= ' clear ' where id = 1003;
Delete data (delete)--"Eg;delete from emp where id = 1003;
Delete from the EMP where job is null; (null value is in IS)
Use SQL to make simple additions and deletions to the database