1.Easy
What is a composite key?
- AA key that allows duplicate values
- BA key made up of two or more columns
- CA key that is generated by the database
- DA key stored in a separate table
2.Easy
What does ROLLBACK do in a transaction?
- ADeletes the table
- BSaves all changes of the transaction permanently to disk
- CRepeats the last statement
- DUndoes the changes made since the transaction began
3.Easy
What is an entity-relationship (ER) diagram used for?
- AModelling entities, their attributes and relationships when designing a database
- BShowing how a query is executed
- CMeasuring database performance
- DListing the users of a database
4.Medium
What does INTERSECT return when used between two SELECT queries?
- AAll rows from both results
- BRows in the first result but not the second
- CRows that appear in both results
- DThe Cartesian product of the results
5.Medium
What does the "A" in ACID stand for?
- AAtomicity
- BAggregation
- CAccuracy
- DAvailability
6.Medium
What does ROLLBACK TO SAVEPOINT s1 do?
- AUndoes the changes made after savepoint s1, keeping the transaction open
- BUndoes the whole transaction from the beginning
- CDeletes the savepoint and all tables changed since then
- DEnds the transaction and commits everything
7.Hard
Table b contains the values 1, 2 and NULL in column y. What does SELECT * FROM a WHERE x NOT IN (SELECT y FROM b) return?
- ANo rows at all
- BOnly rows of a where x is NULL
- CRows of a where x is not 1 or 2
- DEvery row of a
8.Hard
A correlated subquery is one that:
- AReferences columns of the outer query and is evaluated per outer row
- BJoins two tables with a foreign key
- CUses only aggregate functions
- DRuns only once before the outer query and caches its result for every row
Answer key
- 1. B · A key made up of two or more columns
- 2. D · Undoes the changes made since the transaction began
- 3. A · Modelling entities, their attributes and relationships when designing a database
- 4. C · Rows that appear in both results
- 5. A · Atomicity
- 6. A · Undoes the changes made after savepoint s1, keeping the transaction open
- 7. A · No rows at all
- 8. A · References columns of the outer query and is evaluated per outer row
Full step-by-step solutions: practise this topic on examproblems.com.