1.Easy
What does ROLLBACK do in a transaction?
- ASaves all changes of the transaction permanently to disk
- BUndoes the changes made since the transaction began
- CRepeats the last statement
- DDeletes the table
2.Easy
What does a CHECK constraint do?
- AChecks whether a table exists before a query is run on it
- BRejects rows whose values do not satisfy a condition
- CCounts the rows in a table
- DVerifies the user's password
3.Easy
What does UNION do with the results of two SELECT queries?
- AJoins them side by side on a key
- BKeeps only rows that appear in the first query but not the second
- CCombines them into one result and removes duplicate rows
- DKeeps only rows that appear in both
4.Medium
In relational algebra, the projection operator (π) corresponds to:
- ASorting the result
- BChoosing which rows satisfy a given condition
- CChoosing which columns appear in the result
- DCombining two tables on a key
5.Medium
Why are indexes created on columns?
- ATo prevent NULL values
- BTo speed up searches and joins on those columns
- CTo save disk space
- DTo make inserts and updates faster on those columns
6.Medium
What is a database trigger?
- AA scheduled backup of the database
- BA type of index that speeds up searches
- CA query that a user runs by hand
- DCode that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
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?
- AOnly rows of a where x is NULL
- BEvery row of a
- CNo rows at all
- DRows of a where x is not 1 or 2
8.Hard
Given the functional dependencies A → B, B → C and C → D on R(A, B, C, D), what is the closure A+?
- A{A, B}
- B{A, B, C}
- C{A}
- D{A, B, C, D}
Answer key
- 1. B · Undoes the changes made since the transaction began
- 2. B · Rejects rows whose values do not satisfy a condition
- 3. C · Combines them into one result and removes duplicate rows
- 4. C · Choosing which columns appear in the result
- 5. B · To speed up searches and joins on those columns
- 6. D · Code that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
- 7. C · No rows at all
- 8. D · {A, B, C, D}
Full step-by-step solutions: practise this topic on examproblems.com.