Mysql how to add columns, modify column names, column properties, and delete columns
This article mainly explains "how to add columns, modify column properties and delete columns in mysql". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "mysql how to add columns modify column properties and delete columns"!
Text:
Modify table name, column type, add table column, delete table column
Change the table name (set it to testtable and name it newtablename)
Alter table testtable rename newtablename
Add a table column:
Alter table testtable add column name varchar (40)
Delete the column:
Alter table testtable drop column name
Modify the type of column:
Alter table testtable modify address char (40)
Or this: alter table testtable change address address char (40)
Modify table column name
Alter table testtable change column address address1 varchar (30)
At this point, I believe you have a deeper understanding of "mysql how to add columns to modify column properties and delete columns". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!