用SQL语言ALTER语句修改表结构

1、

l STUDENT表中SNO设为非空和唯一,

非空:alter table student  modify sno char(8) not null;

唯一:alter table student add unique(sno);

l STUDENT表中增加一个字段SBIRTH

Alter table student add sbirth text;

l 删除STUDENT表中ADDRESS字段;

Alter table student drop column address;

l COURSE表中CNO字段设为非空和唯一;

非空:alter table course  modify cno char(3) not null;

唯一:alter table course add unique(cno);


你可能感兴趣的:(数据库)