update sc set score=
select a.avg(sc.score)from
(select avg(sc.score)
from sc,teacher,course
where sc.cid=course.cid
and teacher.tid=course.tid
and Tname='叶平')a;
sc 表中有cid sid score 三个字段cid
和sid是外键。
teacher表中有tid tname
course表中有cid tid cname
我现在要做的操作是
把SC表中“叶平”老师教的课的成绩都更改为此课程的平均成绩;