Show all databases: Show databases;
Create Database customer; customer is the database name;
Open Database: Use customer; open the database before you perform various operations;
Customer table ID number name gender age birth date salary phone number
Customer
ID name sex age birth salary phone
Create Table: Create Table customer (ID int (11) not null primary key auto_increment, name varchar (20), sex varchar (2), age int, birth date, salary double, phone varchar (11 ));
Display table structure: describe customer;
Delete table: Drop table customer;
Change the name length to 10.
Alter table: alter table customer modify name varchar (10) Not NULL;
Insert a data entry to the table: Zhang Weinan 20 null NULL;
Insert data: insert into customer values ("Zhang San", "male", 20, null );
Change the age of Michael Jacob to 18;
Modify data: Update customer set age = 19 Where name = "Zhang San ";
Delete Zhang San's data:
Delete data: delete from customer where name = "James ";