针对数据库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'
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'
举一反三
- 建立信息系选修了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_student AS SELECT sno,sname,sage FROM student WHERE sdpt='is'; B: CREATE VIEW is_student SELECT sno,sname,sageFROM WHERE sdpt='is'; C: CREATE VIEW is_student AS select sno,sname,sage FROM WHERE sdpt='is' D: CREATE VIEW is_student AS SELECT sno,sname,sage WHERE sdpt='is';
- 下列SQL语句中,_________可以在“学生-课程”数据库正确实现“将学生的学号及他的平均成绩定义为一个视图”。 A: CREAT VIEW S_G(Sno,Gavg) AS SELECT Sno,AVG(Grade) FROM SCGROUP BY Sno; B: CREAT VIEW S_G(Sno,AVG(Grade)) AS SELECT Sno,AVG(Grade) FROM SCGROUP BY Sno; C: CREAT VIEW S_G AS SELECT Sno,AVG(Grade) FROM SCGROUP BY Sno; D: CREAT VIEW S_G(Sno,Gavg) AS SELECT Sno,AVG(Grade) FROM SCORDER BY Sno;
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,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);
- 查询每个学生的学号、姓名、选修的课程名及成绩,下列()的操作是正确的。 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