MySQL basic Operation 1.mysql table copy MySQL table structure replication
CREATE table t2 like T2
Replication of MySQL table data
INSERT INTO T2 select * from t1
Operation of the 2.mysql index
2.1 Increase of the index
ALTER TABLE Tb_name Add index index_name (column name)
ALTER TABLE Tb_name add unique (column name)
ALTER TABLE Tb_name add primary key (column name)
2.2 Increase of the index
Create INDEX index_name on tb_name (column name)
2.3 Deletion of the index
ALTER TABLE Tb_name DROP INDEX Index_name
ALTER TABLE Tb_name DROP INDEX name (unique)
ALTER TABLE tb_name drop PRIMARY key
Operation of the 3.mysql view
The MySQL view is an intermediate table created by the condition, and the data changes with the condition
3.1 Increase in views
Create VIEW view_name as condition (SELECT * from T1 where id>5)
3.2 Deletion of views
Drop View View_name
MySQL basic operation "MySQL"