SQL Quiz: Subqueries

This SQL quiz covers subqueries: a query nested inside another one in WHERE, SELECT or FROM. You will predict the output of scalar, IN, correlated and derived-table subqueries and learn why some of them fail.

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

मोड चुनें

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

सैंपल सवाल

सवाल 1 / 10

What does this print?

CREATE TABLE products (name TEXT, price INTEGER);
INSERT INTO products VALUES ('pen', 2), ('book', 12), ('bag', 30), ('cup', 5);
SELECT name
FROM products
WHERE price > (SELECT AVG(price) FROM products)
ORDER BY name;
जवाब दिखाएं

A. bag The subquery runs first and returns one value, the average 49 / 4 = 12.25. Only the bag costs more; the book at 12 is just below it.

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

  • Comparing against a scalar subquery like AVG(...)
  • IN (subquery) and why it never duplicates rows
  • Correlated subqueries that run per outer row
  • Subqueries in FROM (derived tables) and their aliases
  • When a subquery can be rewritten as a join

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

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

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

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

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