在STUDENT和SC关系中,删除SNO以‘91’开头的所有记录。
举一反三
- 如果在“学生-课程”数据库中,希望当删除Student表中的元组时,级联删除SC表中相应的元组,则在定义SC表时,应有语句____________________。 A: FOREIGN KEY (Sno) ON DELETE CASCADE Student(Sno) B: FOREIGN KEY (Sno) ON DELETE NO ACTION Student(Sno) C: FOREIGN KEY (Sno) REFERENCES Student(Sno) ON DELETE NO ACTION D: FOREIGN KEY (Sno) REFERENCES Student(Sno) ON DELETE CASCADE
- 现有关系student (sno,sname,sex,age)course(cno,cname,credit)sc(sno,cno,socre)查找王燕所选修的课程的课程和成绩,将查询到哪些关系( ) A: student B: course 和student C: student 和sc D: student,course 和sc
- 中国大学MOOC: 已知学生表为Student(Sno, Sname, Sage, Ssex, Sdept) 。用SQL实现:删除‘控制’系所有学生的选课记录; sc where sno in( select sno from student where sdept=控制)(答案请全部小写字母,答案不要有多余的空格)
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,SQL语句可为( ) A: SELECT DISTINCT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; B: SELECT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; C: SELECT DISTINCT Sno, DISTINCT Sname FROM Student WHERE Student.Sno IN (SELECT Sno FROM SC); D: SELECT Sno, Sname FROM Student WHERE Student.Sno IN (SELECT DISTINCT Sno FROM SC);
- 其中学生关系student的主码是sno,课程关系course的主码是cno,选课关系sc的主码是(sno,cno)。 执行SQL语句: SELEC Tstudent.sno,sname,cno,grade FROM student,sc WHERE sex′女′=and student.sno=sc.sno 则该语句对student和sc执行的操作有()。