某数据库中有表COURSE(CNO,CNAME,TNO)和表TEACHER(TNO,TNAME,DE- PART),完成查询选修某课程
某数据库中有表COURSE(CNO,CNAME,TNO)和表TEACHER(TNO,TNAME,DE- PART),完成查询选修某课程的同学人数多于5人的教师姓名。
SELECT TNAME
FROM TEACHER WHERE
(4)
(SELECT X.TNO FROM COURSE X,COURSE Y
WHERE (5)
(6)
(7)
)
某数据库中有表COURSE(CNO,CNAME,TNO)和表TEACHER(TNO,TNAME,DE- PART),完成查询选修某课程的同学人数多于5人的教师姓名。
SELECT TNAME
FROM TEACHER WHERE
(4)
(SELECT X.TNO FROM COURSE X,COURSE Y
WHERE (5)
(6)
(7)
)
在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。查询至少选修了“201815005”同学所选课程的学生的姓名,可以使用如下SQL语句。 select sname from student s where sno<>‘201815005’ and not exists (select * from sc x where x.sno=’201815005’ and not exists (select * from sc y where y.cno=x.cno and y.sno=s.sno ) )
在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。要查询选修了“Java程序设计”课的的学生姓名,则SQL语句是: select sname from student,sc ,course where 子句。 这里的where子句的内容是()。
A、student.sno=sc.sno and sc.cno=course.cno and cname=’Java程序设计’
B、cname=’Java程序设计’
C、student.sno=sc.sno and cname=’Java程序设计’
D、sc.cno=course.cno and cname=’Java程序设计’
在学生选课数据库S_T中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname,cpno,ccredit)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,cpno是先行课号,ccredit是学分,grade是成绩。以下()SQL语句可以实现查询没有选修’1’号课程的学生姓名。
A、select sname from student where not exists (select * from sc where student.sno=sc.sno and cno=’1’)
B、select sname from student, sc where student.sno=sc.sno and cno !=’1’
C、select sname from student where sno not in (select sno from sc where cno=’1’)
D、select sname from student where exists (select * from sc where student.sno=sc.sno and cno<>’1’)
用SQL语句创建简单数据表
设教学管理数据库中有多张数据表,其中学生表Student包括学生编号Sno,学生姓名
Sname,学生年龄Sage,学生性别Ssex字段;Sno和Sname为字符型(长度20), Sage为整型,
Ssex为位型。Sno是主键。
课程表Course包括课程编号Cno,课程名Cname,授课教师Teacher字段;三个字段均为
字符型(长度20) , Cno是主键。
请用SQL语句创建上面的两张数据表。
A.select count(*) from sc
B.select count(sno) from sc
C.select count(distinct sno) from sc
D.select count(cno) from sc
A.删除student表中的记录
B.修改student表中某条记录的sno值
C.向sc表中插入一条记录
D.修改sc表中某条记录的sno值
A、select sname from student, sc where student.sno=sc.sno and cno='C002'
B、select sname from student where sno = (select sno from sc where cno='C002')
C、select sname from student where exixts (select * from sc where student.sno=sc.sno and cno='C002')
D、select sname from student where sno in (select sno from sc where cno='C002')
A、select sname from student where sno not in (select sno from sc where cno='C002')
B、select sname from student, sc where student.sno=sc.sno and cno !='C002'
C、select sname from student where exixts (select * from sc where student.sno=sc.sno and cno<>'C002')
D、select sname from student where not exixts (select * from sc where student.sno=sc.sno and cno='C002')
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!