1.Easy
What does UNION do with the results of two SELECT queries?
- ACombines them into one result and removes duplicate rows
- BKeeps only rows that appear in the first query but not the second
- CJoins them side by side on a key
- DKeeps only rows that appear in both
2.Easy
Which statement adds a new column to an existing table?
- AUPDATE TABLE
- BALTER TABLE
- CINSERT COLUMN
- DCREATE COLUMN
3.Easy
What is a candidate key?
- AAny column that contains NULL values
- BA column that is waiting to become a foreign key
- CA set of columns shared between two tables to link their rows
- DA minimal set of columns that uniquely identifies each row
4.Medium
What does SELECT SUM(amount) FROM orders return when the WHERE clause matches no rows?
- ANULL
- BAn error
- CAn empty string
- D0
5.Medium
When is WHERE EXISTS (subquery) true for a row?
- AWhen the subquery returns at least one row
- BWhen the subquery returns no NULL values
- CWhen the subquery returns exactly one row
- DWhen the subquery returns a number greater than zero
6.Medium
What does the "A" in ACID stand for?
- AAccuracy
- BAggregation
- CAvailability
- DAtomicity
7.Hard
After customers LEFT JOIN orders, why use COUNT(o.id) rather than COUNT(*) to count orders per customer?
- ACOUNT(*) ignores rows with NULL values
- BCOUNT(o.id) counts only distinct customers
- CCOUNT(*) counts the NULL-filled row as 1 for customers without orders
- DCOUNT(*) is not allowed after a join
8.Hard
When is a schedule of concurrent transactions called serializable?
- AWhen no transaction ever reads data
- BWhen its effect is equivalent to some serial execution of the same transactions
- CWhen the transactions run on one CPU only
- DWhen every transaction is given a serial number
Answer key
- 1. A · Combines them into one result and removes duplicate rows
- 2. B · ALTER TABLE
- 3. D · A minimal set of columns that uniquely identifies each row
- 4. A · NULL
- 5. A · When the subquery returns at least one row
- 6. D · Atomicity
- 7. C · COUNT(*) counts the NULL-filled row as 1 for customers without orders
- 8. B · When its effect is equivalent to some serial execution of the same transactions
Full step-by-step solutions: practise this topic on examproblems.com.