The database name is tentatively: DB
1. Create a database
Create DATABASE db default character set UTF8;
2. Using the database
Use DB;
3. Deleting a database
drop database db;
4. Modifying the character set of a database
ALTER DATABASE DB default CharSet UTF8;
5. View the statement that established the database
Show create database db;
6. Create a table to see its default values
CREATE table T (t int);
7. Create a table
CREATE TABLE T1 (
tid int unsigned not NULL auto_increment,
Tname varchar (+) NOT NULL,
Primary KEY (TID)
) auto_increment=201401;
8. Delete a table
drop table T1;
9. Delete multiple tables in bulk
drop table t1,t2,t3;
10. Modify the table name
Rename table T1 to student;
11. Modify the Type and field name of the fields in the table
ALTER TABLE student change tname sname varchar (+) not null;
12. Add a column
ALTER TABLE student add saddress varchar () after sname;
13. Delete Columns
ALTER TABLE student drop column saddress;
MySQL database defines common operations