SQL Quiz: HAVING

This SQL quiz is about HAVING, the filter that runs after rows are grouped. You will predict which groups survive, combine WHERE and HAVING in one query and learn when to use which.

मीडियम 10 सवाल ~6 मिनट पास होने के लिए 80% SQLite

मोड चुनें

आप गेस्ट के तौर पर खेल रहे हैं: XP और streak सेव रखने के लिए साइन इन करें।

सैंपल सवाल

सवाल 1 / 10

What does this query return?

CREATE TABLE sales (region TEXT, rep TEXT, amount INTEGER);
INSERT INTO sales VALUES ('North', 'Ana', 100), ('South', 'Ben', 200), ('North', 'Cy', 50), ('South', 'Ana', 70), ('East', 'Dee', 30);
SELECT region FROM sales GROUP BY region HAVING SUM(amount) > 100 ORDER BY region;
जवाब दिखाएं

B. North South The totals are East 30, North 150 and South 270. HAVING keeps only groups whose total is over 100: North and South. Note that North passes even though none of its single rows is over 100.

इस क्विज़ में क्या है

  • Filtering groups with HAVING
  • WHERE (rows, before grouping) vs HAVING (groups, after)
  • Using WHERE and HAVING in the same query
  • Conditions on aggregates that are not in the SELECT list
  • Portable HAVING without column aliases

अक्सर पूछे जाने वाले सवाल

क्या अकाउंट ज़रूरी है?

नहीं। कोई भी खेल सकता है। XP, streak, badge और हिस्ट्री सेव रखने के लिए साइन इन करें।

क्या मैं इसे दोबारा दे सकता हूं?

हां। आपका बेस्ट स्कोर सेव रहता है, और हर बार सवाल और जवाब शफ़ल होते हैं।