Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to modify the field type in mysql table
How to modify the field type in mysql table
1. Change the floating-point field type to decimal.

ALTER TABLE table name Modify field name Decimal (10/0,2 2) not null is "0" by default;

For example:

Alter table invoice modify total money decimal (10,2 2) not null defaults to "0";

2. Add fields

Alter table table name add field name field type is not null.

For example:

alter table teacher add type mark varchar(50)null default“”;