• 2021-04-14
    【单选题】针对学生表student(sno,sname,ssex,sage,sdept),其中sno为学号,sname为姓名,ssex为性别,sage为年龄,sdept为系别。查询学生的姓名sname,系别sdept和年龄sage,显示时按系别升序排列,系别相同的再按年龄降序排列。()
    A. select * from student  order by sdept , sage
    B. select sname, sdept, sage  from student  order by sdept , sage desc
    C. select sname, sdept, sage  from student  order by sdept  desc , sage
    D. select * from student  order by sdept  desc, sage
  • select sname, sdept, sage  from student  order by sdept , sage desc

    举一反三

    内容

    • 0

      中国大学MOOC:"针对表Student(sno, sname, ssex, sage, sdept),其中sno为学号,sname为姓名,ssex为性别,sage为年龄,sdept为系别。查询女生平均年龄超过20岁的系别以及女生平均年龄。";

    • 1

      在所有学生中查询比计算机系所有学生年龄都要大的学生姓名,正确的查询语句是___________________。 A: SELECT Sname FROM Student WHERE Sage > ( SELECT MAX(Sage) FROM Student WHERE Sdept = 'CS'); B: SELECT Sname FROM Student WHERE Sage > ALL ( SELECT Sage FROM Student WHERE Sdept = 'CS'); C: SELECT Sname FROM Student S1 WHERE EXISTS ( SELECT Sage FROM Student S2 WHERE Sdept = 'CS' AND S1.Sage > S2.Sage); D: SELECT Sname FROM Student S1 WHERE NOT EXISTS ( SELECT * FROM Student S2 WHERE Sdept = 'CS' AND S1.Sage <= S2.Sage);

    • 2

      设学生关系Students(Sno,Sname,Sex,Sdept,Sage,Sadd),Sno、Sname、Sex、Sdept、Sage、Sadd分别表示学生的学号、姓名、性别、所在系、年龄和住址。查询比计算机系(CS)所有学生年龄都小于其他系的学生姓名及年龄的SQL语句为: SELECT Sname,Sage FROM Students WHERE Sage ______ (SELECT Sage FROM Students WHERE ______) A.Sdept=’CS’ B.Sdept<>’CS’ C.’Sdept’=CS D.’Sdept’<>CS A: AND Sdept<>’CS’;

    • 3

      计算机系年龄最大的学生的信息select *from studentwhere __________________________________ A: sdept='计算机系' and sage=(select max(sage) from student where sdept='计算机系') B: sdept='计算机系' and sage=max(sage) C: sdept='计算机系' or sage=(select max(sage) from student ) D: sdept='计算机系' or sage=max(sage)

    • 4

      要在student(sno,sname,ssex,sage,sdept)表中,查询全体女生的姓名、年龄,以下正确的查询语句是( )。 A: select * from student where ssex='女' B: select 姓名, 年龄 from student where 性别 ='女' C: select sname , sage from student where ssex='女’ D: select sname 姓名, sage 年龄 from student where ssex='女'