mysql的测试题

要求:将score表,student表,class表连接起来,并且筛选出其中的sid,student_id,sname,course_id,cname,number

SELECT
score.sid,
score.student_id,
student.sname,
score.course_id,
course.cname,
score.number
FROM
score
LEFT JOIN student ON score.student_id=student.sid
LEFT JOIN course ON score.course_id = course.cid;

运行结果:

posted @ 2020-03-04 13:18  Stary_tx  阅读(170)  评论(0编辑  收藏  举报