Home  >  Article  >  Database  >  What are the types of fields that mysql can modify?

What are the types of fields that mysql can modify?

coldplay.xixi
coldplay.xixiOriginal
2020-07-02 15:19:364529browse

mysql modified field types include: 1. Add fields [alter table table1 (table name) add No_id (field name)]; 2. Modify field types [t1 (table name) alter column a (field name) ]; 3. Delete a field of a table [drop 'cpid'].

What are the types of fields that mysql can modify?

mysql modified field types are:

1, mysql modified field default value

alter table tb_mer_team_column drop constraint DF_tb_mer_team_column_columnOrder alter table tb_mer_team_column add constraint DF_tb_mer_team_column_columnOrder default 0 for columnOrder

2. mysql statement to add fields

alter table table1(表名)add No_id(字段名) char(12)(字段类型) t null | null   UNIQUE after '字符' 在制定字段后面添加

3. mysql changes field type

alter table t1(表名) alter column a(字段名) text(50)(字段类型)

4. mysql adds primary key field

alter table tb_mer_basInfo add constraint [PK_tb_merchantBasInfo] primary key ( merchantID)

5. mysql deletes a field of a table

alter table `lm_aclass` drop 'cpid'

Related learning recommendations: mysql video tutorial

The above is the detailed content of What are the types of fields that mysql can modify?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn