zz题目
PTA 10-37 创建分组统计视图
create view PerView(专业名,修课人数,平均成绩) as
select a.major, count(distinct a.sno), avg(b.grade)
from Student a, SC b
where a.sno = b.sno
group by a.major
count(distinct)
可以去重。
PTA 10-51 查询名称以“DB_”开头的课程名称
select cname
from course
where cname like "DB\_%"
注意右斜杠的转义字符。
_
通配符,表示一个字符。
PTA 10-53 查询“14计科1”班的学生所学的课程名称和平均成绩
from students a
left join sc b on a.sno = b.sno
left join course c on b.cno = c.cno
where ...
使用多个left join
。