HomeCode HereSQL final quiz SQL final quiz Admin 1 min read Updated November 16, 2026 Ten mixed questions covering the whole SQL track, from SELECT to transactions. SQL SQL final quiz 10 questions, instant feedback Question 1 of 10 Which clause order is valid in a SELECT statement? A SELECT, WHERE, FROM, ORDER BY B SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY C SELECT, GROUP BY, WHERE, ORDER BY D FROM, SELECT, WHERE, LIMIT The written order is fixed: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT. Question 2 of 10 A table has 100 rows and 12 have a NULL email. What does COUNT(email) return? A 100 B 12 C 88 D 0 COUNT(column) counts non-null values, so 100 minus 12 nulls is 88. Question 3 of 10 Which query lists categories with more than five products? A SELECT category, COUNT(*) FROM products WHERE COUNT(*) > 5 GROUP BY category B SELECT category, COUNT(*) FROM products GROUP BY category HAVING COUNT(*) > 5 C SELECT category FROM products HAVING COUNT(*) > 5 D SELECT COUNT(*) FROM products WHERE quantity > 5 Group first, then filter groups with HAVING. Aggregate functions cannot appear in WHERE. Question 4 of 10 Which join finds customers who have never ordered? A INNER JOIN orders ON orders.customer_id = customers.id B LEFT JOIN orders ON orders.customer_id = customers.id WHERE orders.id IS NULL C RIGHT JOIN on the same key D CROSS JOIN A left join keeps every customer; filtering for NULL order ids keeps only those without a match. Question 5 of 10 What does ROLLBACK do? A Saves the transaction B Discards the transaction's changes C Deletes the table D Creates a savepoint ROLLBACK undoes every statement since the transaction began, or since the last savepoint. Question 6 of 10 Which column type best stores a boolean flag in SQLite? A BOOLEAN B INTEGER with 0 and 1 C TEXT with 'yes' D REAL SQLite has no boolean type; INTEGER with CHECK (flag IN (0, 1)) is the usual approach. Question 7 of 10 What is the main risk of SELECT * in application code? A It is slower to type B A schema change silently changes the result shape C It always returns no rows D It cannot use a WHERE clause Naming columns makes the contract explicit, so adding a column does not change what the code receives. Question 8 of 10 Why can LIMIT without ORDER BY return different rows each run? A Because LIMIT is random B Because row order is unspecified without ORDER BY C Because of transactions D Because of indexes Without an explicit order the engine may return rows in any sequence, so the first N rows are not well defined. Question 9 of 10 Which change adds an index on orders.customer_id? A CREATE INDEX idx_orders_customer ON orders (customer_id) B ALTER TABLE orders ADD INDEX customer_id C CREATE TABLE orders_index D INDEX orders(customer_id) CREATE INDEX names the index and the table, then lists the indexed columns. Question 10 of 10 A query joining three tables returns duplicated rows. What is the usual cause? A A missing WHERE clause B A one-to-many join multiplying rows C Too many indexes D Wrong data types Joining a parent to several children multiplies rows. Aggregate with GROUP BY, or join a pre-aggregated subquery. Check my answers Try again Your answers stay in this browser. Nothing is sent to a server. More quizzes Summarising data quiz 9 questions Joins and changes quiz 9 questions Design and safety quiz 9 questions All quizzes