查找数据库表中最大的id
select max(id) from score;
查看数据库表的字段定义类型
show full columns from tableName;
删除字段
alter table student drop column credit;
增加字段
alter table tableName add update_time timestamp default current_timestamp on update current_timestamp;
更改数据值
update tableName set email='232323@qq.com' where id=1;
更改字段数据类型
alter table tableName modify gender int;
修改字段名
alter table score change tnoId tno_id int;
撤销 unique 约束
alter table student drop index sno;
创建 unique 约束
alter table student add unique(sno,cname);

3332

被折叠的 条评论
为什么被折叠?



