diff --git a/2207/MySQL数据库操作综合练习题答案.md b/2207/MySQL数据库操作综合练习题答案.md index 5f01ae7..b3ad63c 100644 --- a/2207/MySQL数据库操作综合练习题答案.md +++ b/2207/MySQL数据库操作综合练习题答案.md @@ -386,6 +386,30 @@ INSERT INTO Records (姓名, 记录) VALUES ![image-20250315230025538](https://yp.smallkun.cn/markdown/image-20250315230025538.png!compress) ```sql +#3 +UPDATE score s +SET s.`语文` = 88 +WHERE s.`姓名` = '张三'; + +#4 +SELECT AVG(s.`英语`), AVG(s.`数学`), AVG(s.`语文`) +FROM classes c, score s +WHERE c.`姓名` = s.`姓名` AND c.`班级` = 1 AND c.`专业` = '计算机维护'; + +#5 +SELECT * +FROM score s +WHERE s.`数学` < 60 OR s.`英语` < 60 OR s.`语文` < 60; + +#6 +SELECT * +FROM score s +WHERE s.`姓名` IN ( + SELECT r.`姓名` + FROM records r + GROUP BY r.`姓名` + HAVING COUNT(*) > 2 +); ``` ---