3. 查询在 SC 表存在成绩的学生信息
第一次
select * FROM student as a
LEFT JOIN sc as b on a.SId=b.SId
group by a.Sname
错误原因:存在空值 未分清楚主次表
第二次:
select a.* FROM student as a
RIGHT JOIN sc as b on a.SId=b.SId
group by a.Sname
3. 查询在 SC 表存在成绩的学生信息
第一次
select * FROM student as a
LEFT JOIN sc as b on a.SId=b.SId
group by a.Sname
错误原因:存在空值 未分清楚主次表
第二次:
select a.* FROM student as a
RIGHT JOIN sc as b on a.SId=b.SId
group by a.Sname