1.Easy
Which aggregate function counts rows?
- ACOUNT
- BAVG
- CMAX
- DSUM
2.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
3.Easy
What is a primary key?
- AA column or set of columns that uniquely identifies each row
- BThe first column of every table
- CA column that may hold duplicate values but must never contain NULL
- DA password for the database
4.Medium
A view in SQL is:
- AA copy of a table on disk
- BAn index type
- CA screen in the database client for browsing tables
- DA stored query that behaves like a virtual table
5.Medium
What does INTERSECT return when used between two SELECT queries?
- ARows that appear in both results
- BThe Cartesian product of the results
- CAll rows from both results
- DRows in the first result but not the second
6.Medium
In relational algebra, the projection operator (π) corresponds to:
- ASorting the result
- BCombining two tables on a key
- CChoosing which columns appear in the result
- DChoosing which rows satisfy a given condition
7.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, C}
- B{A, B}
- C{A}
- D{A, B, C, D}
8.Hard
A reporting database copies customer names into the orders table to avoid joins. What is the main cost of this denormalisation?
- AThe database cannot use indexes any more
- BPrimary keys can no longer be used
- CQueries on the orders table become slower
- DRedundant copies must be kept consistent whenever customer data changes
Answer key
- 1. A · COUNT
- 2. D · A minimal set of columns that uniquely identifies each row
- 3. A · A column or set of columns that uniquely identifies each row
- 4. D · A stored query that behaves like a virtual table
- 5. A · Rows that appear in both results
- 6. C · Choosing which columns appear in the result
- 7. D · {A, B, C, D}
- 8. D · Redundant copies must be kept consistent whenever customer data changes
Full step-by-step solutions: practise this topic on examproblems.com.