Modifying Tables
Modifying Column
Modify the data type of a column:
Add a new column to the end:
Add a new column to the beginning:
Add a new column to a specific location:
Modify the ordering of columns:
Change the name and date type of a column:
Drop a column:
Primary Key and Unique Key
Set primary key (no duplication + no NULL):
Set unique key (no duplication):
Auto-Increment and Default Value
Set auto-increment:
Reset auto-increment index (deletion won't set the counter to 1):
Set default value for a column:
Index
Create index:
Show index (in a nice format):
Drop index:
Last updated