本次MySQL國開形考作業的答案如下:
1. 第一題: SELECT COUNT(*) FROM score WHERE grade >= 60; 2. 第二題: SELECT COUNT(*) FROM student WHERE gender = 'M' AND grade >= 80; 3. 第三題: SELECT MAX(grade), MIN(grade) FROM score WHERE course_id = 'math'; 4. 第四題: SELECT COUNT(*) FROM ( SELECT student_id FROM score WHERE course_id = 'chinese' INTERSECT SELECT student_id FROM score WHERE course_id = 'math' ) AS common_student; 5. 第五題: SELECT AVG(grade), gender FROM score JOIN student ON score.student_id = student.id GROUP BY gender;
以上答案僅供參考,如有不同意見請您斟酌參考。
下一篇dockerhook