公司培训专用SQL语句,SQLserver基础考核。含有基础数据插入SQL。 问题: 1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC where C#='001') a,(select s#,score from SC where C#='002') b where a.score>b.score and a.s#=b.s#; 2、查询平均成绩大于60分的同学的学号和平均成绩; selec
--含数据库 --1、查询"1"课程比"2"课程成绩高的所有学生的学号; select d.S# from (select b.S#,b.score as b_score,c.score as c_score from (select S#,score from Sc WHERE C#=1) b inner join (select S#,score from Sc WHERE C#=2) c on b.S#=c.S#) d where d.b_score>d.c_score --2、查