diff --git a/2208/天天乐学考试答案/MySQL练习(一).md b/2208/天天乐学考试答案/MySQL练习(一).md index 7ae477a..4960bcd 100644 --- a/2208/天天乐学考试答案/MySQL练习(一).md +++ b/2208/天天乐学考试答案/MySQL练习(一).md @@ -335,15 +335,19 @@ FROM tb_students s WHERE TIMESTAMPDIFF(YEAR,s.birthday,'2023-12-01') BETWEEN 30 AND 40; #7 - +SELECT st.stuname, st.gender, st.birthday, c.cname, sc.score, + IF(sc.score >= 90, '优秀', + IF(sc.score >= 80, '良好', + IF(sc.score >= 70, '中等', + IF(sc.score >= 60, '及格', '不及格')))) +FROM tb_students st, tb_scores sc, tb_courses c +WHERE st.stuid = sc.student_id AND sc.course_id = c.cid +ORDER BY sc.score DESC; #8 ``` -### 第五套 -```sql -```