1.Easy
What is a composite key?
- AA key made up of two or more columns
- BA key stored in a separate table
- CA key that allows duplicate values
- DA key that is generated by the database
2.Easy
Statements such as CREATE, ALTER and DROP belong to which part of SQL?
- AData Control Language (DCL)
- BData Manipulation Language (DML)
- CData Definition Language (DDL)
- DTransaction Control Language (TCL)
3.Easy
Which keyword sorts the result of a query?
- ASORT
- BORDER BY
- CARRANGE
- DGROUP BY
4.Medium
A foreign key is declared with ON DELETE CASCADE. What happens when a parent row is deleted?
- AThe child rows that reference it are deleted automatically
- BThe parent row is copied to an archive table
- CThe delete is always rejected
- DThe foreign key in the child rows is set to NULL automatically
5.Medium
What does SELECT COALESCE(phone, 'unknown') FROM customers return for a customer whose phone is NULL?
- ANULL
- B'unknown'
- CAn empty string
- DAn error
6.Medium
What does EXCEPT (called MINUS in Oracle) return?
- ARows that appear in both queries
- BAll rows from both queries without duplicates
- CRows of the first query that do not appear in the second
- DRows of the second query that do not appear in the first one
7.Hard
Two doctors on call each check that the other is still on call, then both sign off at the same time. Which anomaly can snapshot isolation still allow here?
- ANon-repeatable read within one transaction
- BDirty read
- CWrite skew
- DDirty write
8.Hard
Why is SELECT dept, name, COUNT(*) FROM emp GROUP BY dept invalid in standard SQL?
- AGROUP BY must list all columns of the table
- Bdept must appear inside an aggregate function
- CCOUNT(*) cannot be used together with GROUP BY
- Dname is neither grouped nor aggregated, so it has no single value per group
Answer key
- 1. A · A key made up of two or more columns
- 2. C · Data Definition Language (DDL)
- 3. B · ORDER BY
- 4. A · The child rows that reference it are deleted automatically
- 5. B · 'unknown'
- 6. C · Rows of the first query that do not appear in the second
- 7. C · Write skew
- 8. D · name is neither grouped nor aggregated, so it has no single value per group
Full step-by-step solutions: practise this topic on examproblems.com.