7.1查询所有课程成绩小于70分学生的学号、姓名
1)左连接查询学生和成绩信息
SELECT * FROM score LEFT JOIN student ON score.stu_id=student.stu_id;
SELECT student.`stu_id` 学生编号,student.`stu_name` 学生姓名,score.`course_id` 课程名称,score.`score` 成绩 FROM score LEFT JOIN student ON score.stu_id=student.stu_id;
2)使用where语句筛选出成绩低于70的学生信息
SELECT student.`stu_id` 学生编号,student.`stu_name` 学生姓名,score.`course_id` 课程名称,score.`score` 成绩 FROM score LEFT JOIN student ON score.stu_id=student.stu_id
WHERE score<70;
二.1:从成绩表中查询成绩低于70的学生学号
SELECT stu_id