我创建了这么样的一个表:
create table S (
SNO varchar(5),
SNAME varchar(20),
AGE varchar(3),
SEX varchar(2),
SDEPT varchar(10)
);
create table SC (
SNO varchar(5),
CNO varchar(5),
GRADE varchar(10),
);
create table C (
CNO varchar(5),
CNAME varchar(20),
CDEPT varchar(10),
TNAME varchar(20)
);
insert into S(SNO,SNAME,AGE,SEX,SDEPT) values('01','佐助','15','男','学生部');
insert into S(SNO,SNAME,AGE,SEX,SDEPT) values('02','鸣人','15','男','学生部');
insert into S(SNO,SNAME,AGE,SEX,SDEPT) values('04','小樱','13','女','学生部');
insert into S(SNO,SNAME,AGE,SEX,SDEPT) values('03','小李','15','男','学生部');
insert into SC(SNO,CNO,GRADE) values('01','002','一班');
insert into SC(SNO,CNO,GRADE) values('04','002','一班');
insert into SC(SNO,CNO,GRADE) values('03','001','二班');
insert into SC(SNO,CNO,GRADE) values('01','003','二班');
insert into C(CNO,CNAME,CDEPT,TNAME) values('001','火遁术','火影部','纲手');
insert into C(CNO,CNAME,CDEPT,TNAME) values('002','写轮眼','火影部','卡卡西');
insert into C(CNO,CNAME,CDEPT,TNAME) values('003','体术','火影部','李');
----------------------------------------------------------------------------------------------------------------
要求:
1 检索至少选修两门的课程的学生姓名,没有就为null.
2 检索全部学生都选修的课程的课程号和课程名,没有就为null.