8、查询「李」姓老师的数量
解法1:
select count(*)
from teacher
where tname like '李%';
网络答案:
SELECT COUNT(*) AS 李姓老师数量
FROM (SELECT * FROM Teacher WHERE Tname LIKE '李%') as TeacherLi;
没搞懂网络答案为什么要引用子查询(好像有点懂了……)
9、查询学过「张三」老师授课的同学的信息
SELECT S2.Sid, S2.Sname, S2.Sage