Home >Database >Mysql Tutorial >sql creates tables, modifies table structures, and deletes tables
1. Create a database table
--Which database to use, if you don’t write this sentence, it is the default database, you can also use the mouse to select the current database
use testDB
--Create table
Create Table tablename
(
.
id int primary key not null identity(1,1), --unique name varchar(20) not null unique ) 2. Delete tableDrop table table name3. Modify the table structure--Add columnAlter table table nameAdd column name type--Delete columnAlter table table name drop cloumn column name--Modify column, modify column TypeAlter table table nameAlter column column name type