用SQL语言创建数据表
(1)创建学生表studentcreate table student
( sno char(8),sname char(20),ssex char(2),sdept char(20),sage smallint);
(2)创建课程表course
create table course
( cno char(3),cname char(20),credit char(2),cpno char(3));
(3)创建选课表sc
create table sc
( sno char(8),cno char(3),grade smallint);
3:用SQL语言alter语句修改
(1)student 表中sno设为非空和唯一
alter table student
add constraint pk_sno primary key(sno);
(2)student表中增加一个字段sbirth,类型设置为日期时间类型,增加一个address字段
,类型为文本(字符);
alter table student
add column sbirth datetime ,
address char(20);
(3)删除student表中address字段;
alter table student
drop address;
(4)course表中cno字段设为非空和唯一;
alter table course
add constraint pk_