SQL Database Foundations and Basics Quiz
A 50-question beginner SQL database quiz covering essential SQL commands, data retrieval, table structures, constraints, data types, and simple relational concepts.
Question 1
What is a database primarily used for?
Question 2
A table in a relational database is best described as:
Question 3
Which item represents a single record in a table?
Question 4
Which SQL category does SELECT belong to?
Question 5
SQL stands for:
Question 6
Which command adds new data into a table?
Question 7
Which SQL statement removes rows?
Question 8
The UPDATE statement is used to:
Question 9
What does this query return?
SELECT name FROM employees;Question 10
Which of the following is a valid SQL keyword?
Question 11
Which clause filters rows?
Question 12
Which operator performs pattern matching?
Question 13
What does this query return?
SELECT * FROM products WHERE price > 100;Question 14
What does ORDER BY do?
Question 15
A primary key is used to:
Question 16
What does a foreign key represent?
Question 17
What will this query return?
SELECT id, email FROM users WHERE active = 1;Question 18
A table column describing data type rules is called:
Question 19
Which clause groups rows before applying aggregate functions?
Question 20
What does this query calculate?
SELECT COUNT(*) FROM orders;Question 21
Which join returns only matching rows from both tables?
Question 22
A LEFT JOIN will return:
Question 23
What does this join accomplish?
SELECT customers.name, orders.total
FROM customers
INNER JOIN orders ON customers.id = orders.customer_id;
Question 24
NULL represents:
Question 25
Which comparison with NULL evaluates as true?
Question 26
What does this query return?
SELECT * FROM users WHERE name LIKE 'A%';Question 27
Which data type is commonly used for text?
Question 28
Which data type is used to store whole numbers?
Question 29
A NOT NULL constraint means:
Question 30
A UNIQUE constraint ensures:
Question 31
A company needs to track customers and their orders. Which statement is true in a simple relational model?
Question 32
Why should related tables use foreign keys?
Question 33
What does this query do?
DELETE FROM products
WHERE discontinued = 1;
Question 34
Which clause limits how many rows a query returns?
Question 35
What happens if you run SELECT * on a large table?
Question 36
What does this query return?
SELECT name FROM employees ORDER BY name DESC;Question 37
Which statement describes normalization?
Question 38
Indexes are mainly used to:
Question 39
What does this SQL do?
UPDATE users SET active = 0 WHERE last_login < '2023-01-01';Question 40
Which statement starts a transaction?
Question 41
COMMIT is used to:
Question 42
ROLLBACK is used when:
Question 43
What does this query do?
SELECT DISTINCT city FROM users;Question 44
Which keyword combines results from two SELECT statements?
Question 45
An empty string ('') is:
Question 46
Which clause renames a column in a result?
Question 47
Which statement deletes an entire table?
Question 48
Which keyword returns the largest value in a numeric column?
Question 49
Why should column types be chosen carefully?
Question 50
Why are SQL databases widely used?
