建立信息系选修了1号课程的学生视图,正确的SQL语句为()
A: CREATE VIEW IS_S1 ASSELECT Student.Sno,Sname,Grade FROM Student,SCWHERE Sdept= 'IS' AND Student.Sno=SSno AND SCno= '1';
B: CREATE VIEW IS_S1 (Sno,Sname,Grade) ASSELECT Student.Sno,Sname,Grade FROM Student,SCWHERE Sdept= 'IS' AND SCno= '1';
C: CREATE VIEW IS_S1 (Sno,Sname,Grade) ASSELECT Student.Sno,Sname,GradeFROM Student,SC WHERE Sdept= 'IS' ANDStudent.Sno=SSno AND SCno= '1'
A: CREATE VIEW IS_S1 ASSELECT Student.Sno,Sname,Grade FROM Student,SCWHERE Sdept= 'IS' AND Student.Sno=SSno AND SCno= '1';
B: CREATE VIEW IS_S1 (Sno,Sname,Grade) ASSELECT Student.Sno,Sname,Grade FROM Student,SCWHERE Sdept= 'IS' AND SCno= '1';
C: CREATE VIEW IS_S1 (Sno,Sname,Grade) ASSELECT Student.Sno,Sname,GradeFROM Student,SC WHERE Sdept= 'IS' ANDStudent.Sno=SSno AND SCno= '1'
举一反三
- 查询每个学生的学号、姓名、选修的课程名及成绩,下列()的操作是正确的。 A: select student,sno,sname,grade from student,sc where student.sno=sc.sno and sc.cno=course.cno B: select student,sno,sname,grade from student,sc,cource where student.sno=sc.sno C: select student,sno,sname,grade from student,sc,cource where sc.cno=course.cno D: select student,sno,sname,grade from student,sc,cource where student.sno=sc.sno and sc.cno=course.cno
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,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);
- 针对数据库S_T,以下创建视图的命令不正确的是( )。 A: create view view1asselect sno,avg(grade)from scgroup by sno B: create view view2asselect sno,sname,sdeptfrom studentwhere sdept='CS' C: create view view3asselect sno,sage+20from studentwhere ssex='女' D: create view view4asselect student.sno,sname,sc.sno,cno,grade from sc,studentwhere sc.sno=student.sno and cno='1'
- 下列SQL语句中,_________可以在“学生-课程”数据库正确实现“查询所有选修了1号课程的学生姓名”。 A: SELECT SnameFROM Student, SCWHERE SC.Cno= '1' B: SELECT SnameFROM Student, SCWHERE Student.Sno=SC.Sno AND SC.Cno= 1 C: SELECT Sname FROM Student WHERE Sno= (SELECT Sno FROM SC WHERE Cno= '1') D: SELECT Sname FROM Student WHERE EXISTS (SELECT * FROM SC WHERE Sno=Student.Sno AND Cno= '1')
- 对于学生信息表:student(sno,sname,sex,age,grade),查询学习成绩为空的学生的学号和姓名,下面语句正确的是 A: SELECT sno,sname FROM student WHERE grade=NULL B: SELECT sno,sname FROM student WHERE grade IS NULL C: SELECT sno,age FROM student WHERE grade IS NULL D: SELECT sno,age FROM student WHERE grade=NULL