Home > Database > Mysql Tutorial > body text

What are the types of fields that mysql can modify?

coldplay.xixi
Release: 2020-07-02 15:19:36
Original
4539 people have browsed it

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 '字符' 在制定字段后面添加
Copy after login

3. mysql changes field type

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

4. mysql adds primary key field

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

5. mysql deletes a field of a table

alter table `lm_aclass` drop 'cpid'
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template