--------------------------表結構--------------------------測試
student(StuId,StuName,StuAge,StuSex) 學生表spa
teacher(TId,Tname) 教師表code
course(CId,Cname,C_TId) 課程表blog
sc(SId,S_CId,Score) 成績表class
----------------------------------------------------------di
問題十三:把「SC」表中「葉平」老師教的課的成績都更改成此課程的平均成績co
-- 複製sc建立測試表score UPDATE score SET Score= (SELECT AVG(Score) FROM sc WHERE sc.S_CId=score.S_CId) WHERE S_CId IN (SELECT CId FROM course INNER JOIN teacher ON course.C_TId=teacher.TId WHERE TName="葉平");
答案僅供參考,不必定徹底正確,若發現錯誤或有更好的,歡迎評論,互相交流,一塊兒成長!!!錯誤