SQL Quiz: COUNT, SUM, AVG, MIN & MAX

This SQL quiz covers the aggregate functions COUNT, SUM, AVG, MIN and MAX. You will predict their results, see how they work on text and expressions, and learn why an aggregate cannot go in WHERE.

आसान 10 सवाल ~5 मिनट पास होने के लिए 80% SQLite

मोड चुनें

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

सैंपल सवाल

सवाल 1 / 10

What does this query return?

CREATE TABLE sales (item TEXT, qty INTEGER, price INTEGER);
INSERT INTO sales VALUES ('pen', 3, 2), ('book', 1, 12), ('mug', 2, 8), ('pen', 4, 2);
SELECT COUNT(*) FROM sales;
जवाब दिखाएं

B. 4 COUNT(*) counts rows, and the table has 4. It does not count different items (that would be COUNT(DISTINCT item), which is 3) or add up quantities.

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

  • Counting rows with COUNT(*)
  • Totals and averages with SUM and AVG
  • MIN and MAX on numbers and text
  • Aggregating an expression like SUM(qty * price)
  • Why WHERE qty = MAX(qty) fails

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

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

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

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

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