SQL Database Basic Query Selection Quiz
A 40-question challenge focused on SELECT operations including filtering, sorting, limiting, pattern matching, aliases, expressions, and DISTINCT usage.
Question 1
What is the primary purpose of a SELECT statement?
Question 2
What does the * symbol mean when used in a SELECT clause?
Question 3
Why might selecting specific columns instead of * be beneficial?
Question 4
Which clause chooses where data is retrieved from?
Question 5
Which keyword filters rows based on conditions?
Question 6
Which operator checks inequality in many query dialects?
Question 7
DISTINCT is used to:
Question 8
What does ORDER BY do?
Question 9
Which keyword limits how many rows a query returns?
Question 10
Why use column aliases?
Question 11
What does this return?
SELECT name FROM staff;Question 12
Which rows appear?
SELECT * FROM orders WHERE status = 'pending';Question 13
Interpret this:
SELECT * FROM items WHERE price > 20;Question 14
What is the effect?
SELECT email FROM users ORDER BY email DESC;Question 15
What result is returned?
SELECT * FROM sales LIMIT 5;Question 16
Predict the output:
SELECT DISTINCT city FROM customers;Question 17
What does LIKE do here?
SELECT * FROM users WHERE name LIKE 'A%';Question 18
Interpret this:
SELECT name, age FROM members WHERE age BETWEEN 20 AND 30;Question 19
What is the result?
SELECT id, (price * quantity) AS total FROM orders;Question 20
What does this return?
SELECT UPPER(name) FROM authors;Question 21
What rows appear?
SELECT * FROM invoices WHERE paid = 0;Question 22
Interpret the sorting:
SELECT name FROM employees ORDER BY age, name;Question 23
What does this produce?
SELECT LENGTH(title) FROM books;Question 24
Evaluate the effect:
SELECT price FROM products ORDER BY price ASC LIMIT 1;Question 25
What does this LIKE pattern match?
SELECT * FROM items WHERE code LIKE 'AB_';Question 26
What is the outcome?
SELECT name, age FROM users WHERE age <> 18;Question 27
Interpret this calculation:
SELECT price - discount FROM products;Question 28
What does this return?
SELECT COUNT(*) FROM visits;Question 29
How is the result sorted?
SELECT title FROM films ORDER BY title DESC;Question 30
What is returned?
SELECT name FROM clients LIMIT 1;Question 31
Which wildcard matches any sequence of characters?
Question 32
Which wildcard matches exactly one character?
Question 33
Which operator joins multiple filter conditions?
Question 34
Which clause is used to rename a column?
Question 35
Which clause appears last logically in a typical SELECT?
Question 36
Selecting too many columns may:
Question 37
Why might DISTINCT reduce row count?
Question 38
Which clause determines which table to retrieve from?
Question 39
Expressions in SELECT are used to:
Question 40
What makes SELECT a foundational query?
