1.Easy
What is a surrogate key?
- AAn artificial identifier with no business meaning, such as an auto-increment id
- BA key made from real-world data such as an email address
- CA key that is only used in views
- DA key that refers to another table
2.Easy
Which SQL statement changes values in rows that already exist?
- AINSERT
- BMODIFY
- CUPDATE
- DREPLACE COLUMN
3.Easy
What does GROUP BY do in a query?
- ASorts the rows of the result alphabetically
- BPuts rows with the same values into groups so aggregates are computed per group
- CJoins two tables on their common columns
- DRemoves rows with NULL values
4.Medium
What is SQL injection?
- AA way to add indexes
- BA database backup technique
- CA technique for inserting many rows quickly with a single INSERT statement
- DAn attack where user input changes the structure of a SQL query
5.Medium
When is WHERE EXISTS (subquery) true for a row?
- AWhen the subquery returns no NULL values
- BWhen the subquery returns a number greater than zero
- CWhen the subquery returns at least one row
- DWhen the subquery returns exactly one row
6.Medium
In relational algebra, the projection operator (π) corresponds to:
- ASorting the result
- BChoosing which columns appear in the result
- CChoosing which rows satisfy a given condition
- DCombining two tables on a key
7.Hard
When is decomposing R into R1 and R2 guaranteed to be lossless?
- AWhen every attribute of R appears in both R1 and R2
- BWhen the common attributes of R1 and R2 form a superkey of R1 or of R2
- CWhen R1 and R2 have no attributes in common
- DWhen R1 and R2 have the same number of columns
8.Hard
With multiversion concurrency control (MVCC), how can readers avoid blocking writers?
- AReaders see a consistent snapshot of committed row versions while writers create new versions
- BReaders always wait until all writers have committed
- CWriters are not allowed while any reader is active
- DReaders read uncommitted data directly
Answer key
- 1. A · An artificial identifier with no business meaning, such as an auto-increment id
- 2. C · UPDATE
- 3. B · Puts rows with the same values into groups so aggregates are computed per group
- 4. D · An attack where user input changes the structure of a SQL query
- 5. C · When the subquery returns at least one row
- 6. B · Choosing which columns appear in the result
- 7. B · When the common attributes of R1 and R2 form a superkey of R1 or of R2
- 8. A · Readers see a consistent snapshot of committed row versions while writers create new versions
Full step-by-step solutions: practise this topic on examproblems.com.