第15题: [简答题]对于教学数据库的3个基本表: S(Sno,Sname,Sage,Ssex); SC(Sno,CNo,Grade); C(CNo,CName,Teacher). SQL更新语句表达对下列的更新操作: ①把WANG同学的选修课和成绩全部删去。 ②把选修Maths课及格的成绩全改为空值。 ③把低于总平均成绩的女同学成绩提高5%。 参考答案:①DELETE FROM SC WHERE Sno IN (SELECT Sno FROM S WHERE Sname=’WANG’); ②UPDATE SC SET Grade=NULL WHERE Grade<60 AND CNo IN (SELECT CNo FROMC WHERE Cname=’Maths’) ③UPDATE SC SET Grade=Grade*1.05 WHERE Sno IN (SELECT Sno FROM S WHERE Ssex=’F’) AND Grade<(SELECT AVG(Grade) FROM SC);