1, show tables; Select * from table where name = ‘1’; Mysql > create table name (‘ id ‘, ‘id’, ‘id’, ‘id’); ENGINE=InnoDB DEFAULT CHARSET=utf8 CREATE TABLE tab1 (nid int(11)) NOT NULL AUTO_INCREMENT, # NOT NULL, AUTO_INCREMENT = NAME VARCHAR (255) DEFAULT ZHANGYANLIN, # default: email varchar(255); PRIMARY KEY (nid) # InnoDB DEFAULT CHARSET=utf8; Note: Default value, you can specify the default value when creating a column, when inserting data, if not actively set the default value automatically increment, if a column is set to increment, insert data, do not need to set this column, the default will increment (there can only be one self-increment column) Primary key: A special unique index that does not allow null values. If the primary key uses a single column, its value must be unique. If it uses multiple columns, its combination must be unique. 3, delete table drop table table name 3, clear the table contents delete from the table name truncate table table 4, modify table copying code to add columns: Alter table alter table drop column drop column alter table modify column drop column alter table modify column drop column; Alter table alter table alter table alter table alter table Alter table alter table add primary key; Alter table alter table drop primary key; Alter table modify int, drop primary key; Alter table add constraint FK_ primary table foreign key references primary table add constraint FK_ primary table foreign key references primary table Alter table test_tbl alter I SET DEFAULT 1000; alter table test_tbl alter I SET DEFAULT 1000; alter table test_tbl alter I SET DEFAULT 1000; ALTER TABLE TESTAL_TBL ALTER I DROP DEFAULT;