第一题:select 姓名,性别 from s,c,sc where a.学号=sc.学号 and sc.课程号=c.课程号 and 成绩>60; 第二题:select 姓名 from s,c,sc where a.学号=sc.学号 and sc.课程号=c.课程号 and 成绩>70 and 课程名='数学' order by 成绩 desc;
1.select 姓名,性别 from s where exists (select 1 from sc where sc.学号=s.学好 and sc.成绩>10) 2.select 姓名 from s,sc where sc.学号=s.学号 and exists (select 1 from c where c.课程号=sc.课程号 and c.课程名='数学')
1.select 姓名,性别 from s where exists (select 1 from sc where sc.学号=s.学好 and sc.成绩>10) 2.select 姓名 from s,sc where sc.学号=s.学号 and exists (select 1 from c where c.课程号=sc.课程号 and c.课程名='数学') and sc.成绩>70 order by sc.成绩 desc
select sex,grade from s join s on sc where sc.grade >60 and sc.number= s.number你看看对不对,我也没试过
第二题:select 姓名 from s,c,sc where a.学号=sc.学号 and sc.课程号=c.课程号 and 成绩>70
and 课程名='数学' order by 成绩 desc;
2.select 姓名 from s,sc where sc.学号=s.学号 and exists (select 1 from c where c.课程号=sc.课程号 and c.课程名='数学')
2.select 姓名 from s,sc where sc.学号=s.学号 and exists (select 1 from c where c.课程号=sc.课程号 and c.课程名='数学') and sc.成绩>70 order by sc.成绩 desc
join s on sc where sc.grade >60 and sc.number= s.number你看看对不对,我也没试过