1.Easy
A foreign key is:
- AA key used by foreign users
- BA key that is always encrypted
- CA column that refers to the primary key of another table
- DA column whose values must be unique across all rows of the table
2.Easy
What does GROUP BY do in a query?
- AJoins two tables on their common columns
- BSorts the rows of the result alphabetically
- CRemoves rows with NULL values
- DPuts rows with the same values into groups so aggregates are computed per group
3.Easy
Which aggregate function returns the average of a numeric column?
- AMEAN
- BSUM
- CAVG
- DMEDIAN
4.Medium
A table stores the customer's address on every order row. Changing the address in one row but not in the others is an example of:
- AAn update anomaly
- BAn insertion anomaly
- CA phantom read
- DA deletion anomaly
5.Medium
Third normal form (3NF) removes:
- ARedundant indexes on columns that are not part of a key
- BComposite keys
- CAtomic values
- DTransitive dependencies between non-key attributes
6.Medium
What is a database trigger?
- AA scheduled backup of the database
- BA query that a user runs by hand
- CA type of index that speeds up searches
- DCode that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
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?
- ADirty read
- BNon-repeatable read within one transaction
- CDirty write
- DWrite skew
8.Hard
For an equality join between two large tables with no useful indexes, which join algorithm does an optimiser often choose?
- ABitmap join on the primary key
- BCross join
- CNested loop join with index lookups
- DHash join
Answer key
- 1. C · A column that refers to the primary key of another table
- 2. D · Puts rows with the same values into groups so aggregates are computed per group
- 3. C · AVG
- 4. A · An update anomaly
- 5. D · Transitive dependencies between non-key attributes
- 6. D · Code that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
- 7. D · Write skew
- 8. D · Hash join
Full step-by-step solutions: practise this topic on examproblems.com.