From 8b030d5a289f20a0094796249e777646ce815100 Mon Sep 17 00:00:00 2001 From: smallkun Date: Tue, 18 Mar 2025 19:12:14 +0800 Subject: [PATCH] Auto commit --- 2207/MySQL数据库操作综合练习题答案.md | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/2207/MySQL数据库操作综合练习题答案.md b/2207/MySQL数据库操作综合练习题答案.md index b3ad63c..9c222b0 100644 --- a/2207/MySQL数据库操作综合练习题答案.md +++ b/2207/MySQL数据库操作综合练习题答案.md @@ -505,6 +505,35 @@ INSERT INTO book (bid, bname, bsortno, pressid) VALUES (1, '红与黑', 11, 100), (2, '幻城', 12, 102), (3, '希腊神话', 13, 102); + +#5 +SELECT b.* +FROM book b, press p +WHERE p.pressid = b.pressid AND p.pressid = 100; + +#6 +SELECT b.* +FROM book b, press p +WHERE p.pressid = b.pressid AND p.pressname = '外研社'; + +#7 +SELECT * +FROM sort s +WHERE s.scount > 100; + +#8 +SELECT p.* +FROM book b, press p +WHERE p.pressid = b.pressid +GROUP BY b.pressid +HAVING COUNT(*) = ( + SELECT COUNT(*) + FROM book b, press p + WHERE p.pressid = b.pressid + GROUP BY b.pressid + ORDER BY COUNT(*) DESC + LIMIT 1 +); ``` ---