关于sql的面试题求高手解答

student表(Sno,Sname,Sage,Ssex)
course表(Cno,Cname,Ccredit)
SC表(Sno,Cno,grade)
建表student、course、SC
查询年龄小于20的学生学号、年龄并显示
查询年两不在20-30(包括20、30)的学生的成绩
图书(图书号,图书名,作者编号,出版社,出生日期)
作者(作者姓名,作者编号,年龄,性别)
用SQL语句查询年龄小于平均年龄的作者姓名、图书名、出版社

1、select Sno,Sage from student where Sage<20;
2、select s.Sname,c.Cname,SC.grade from student s,course c, SC where s.Sno=SC.Sno and c.Cno=SC.Cno;
3、select 作者.作者姓名,图书.图书名,图书.出版社 from 图书,作者 where 图书.作者编号=作者.作者编号 and 作者.作者编号 in (select 作者编号 from 作者 where 年龄<(select AVG(年龄) from 作者))
温馨提示:答案为网友推荐,仅供参考
相似回答