数据库上机实验题目和答案.docxVIP

  • 50
  • 0
  • 约3.79千字
  • 约 3页
  • 2021-10-13 发布于内蒙古
  • 举报
数据库上机实验题目和答案 试用SQL的查询语句表达下列查询: 1. 检索王丽同学所学课程的课程号和课程名。 select Cno ,Cname from c where Cno in (select cno from sc where sno in (select sno from s where sname=王丽 )) 2. 检索年龄大于23岁的男学生的学号和姓名。 select sno,sname from s where sex=男 and age23 3. 检索‘c01’课程中一门课程的女学生姓名 select sname from s where sex=女 and sno in (select sno from sc where cno=c01) 4. 检索s01同学不学的课程的课程号。 select cno from c where cno not in (select cno from sc where sno =s01) 5. 检索至少选修两门课程的学生学号。 select sc.sno from s,sc where s.sno=sc.sno group by sc.sno having count(sc.cno)=2 6. 每个学生选修的课程门数。 解法一: select so.sno sno,

文档评论(0)

1亿VIP精品文档

相关文档