原SQL语句
解读结果
- 子查询从表Course(交叉连接Teacher)中
FROM
按条件
WHERE
Teacher.TNO = Course.TNO AND Tname = '叶平'
取出
SELECT
count(CNO)
记子查询结果为$B
- 子查询从表SC(交叉连接Course)(交叉连接Teacher)中
FROM
按条件
WHERE
SC.CNO = Course.CNO AND Teacher.TNO = Course.TNO AND Teacher.Tname = '叶平'
按SNO分组
GROUP BY
过滤出
HAVING
count(SC.CNO) = $B
取出
SELECT
SNO
记子查询结果为$A
-
查从表Student中
FROM
按条件
WHERE
SNO IN $A
取出
SELECT
SNO
Sname