跳至主要內容

MySQL SQL 语句

zedo2023年5月12日小于 1 分钟约 152 字

MySQL SQL 语句

获取表的描述

desc 表名;

修改表

添加列(add)

alter table 表名 add 列名 列的类型 [列的约束];

alter table student add score int not null;

修改列(modify)

alter table 表名 modify 列名 列的类型 [列的约束];

alter table student modify sex varchar(1);

修改列(change),包含列名

alter table 表名 change 列名 新列名 列的类型 [列的约束];

alter table student change sex gender varchar(1);

删除列(drop)

alter table 表名 drop 列名;

alter table student drop score;

修改表名(rename)

rename table 旧表名 to 新的表名

尽量不要使用

2023-9-14 更新
重启 search-pro,css 样式调整