数据库

2019-04-12  本文已影响0人  c667ec5a71d8

from Student,SC

where Student.S#=SC.S# and C# in (select C# from SC where S#='1001');

11、删除学习“叶平”老师课的SC表记录;

Delect SC

from course ,Teacher

where Course.C#=SC.C# and Course.T#= Teacher.T# and Tname='叶平';

12、查询各科成绩最高和最低的分:以如下形式显示:课程ID,最高分,最低分

SELECT L.C# 课程ID,L.score 最高分,R.score 最低分

FROM SC L ,SC R

WHERE L.C# = R.C#

and

L.score = (SELECT MAX(IL.score)

FROM SC IL,Student IM

WHERE IL.C# = L.C# and IM.S#=IL.S#

GROUP BY IL.C#)

and

R.Score = (SELECT MIN(IR.score)

FROM SC IR

WHERE IR.C# = R.C#

GROUP BY IR.C# );

1

上一篇下一篇

猜你喜欢

热点阅读