1.Easy
Which clause filters rows before grouping?
- AGROUP BY
- BWHERE
- CHAVING
- DORDER BY
2.Easy
What does a UNIQUE constraint on a column guarantee?
- AThe column cannot be changed after insert
- BThe column values are sorted
- CNo two rows have the same non-NULL value in that column
- DThe column automatically becomes the primary key of the table
3.Easy
What is a primary key?
- AA column that may hold duplicate values but must never contain NULL
- BA column or set of columns that uniquely identifies each row
- CA password for the database
- DThe first column of every table
4.Medium
What does a common table expression (WITH name AS (...)) provide?
- AA permanent table that stays stored on disk until it is dropped
- BAn index on a column
- CA new database user
- DA named temporary result that can be used within one statement
5.Medium
In relational algebra, the projection operator (π) corresponds to:
- ASorting the result
- BCombining two tables on a key
- CChoosing which rows satisfy a given condition
- DChoosing which columns appear in the result
6.Medium
A view in SQL is:
- AAn index type
- BA copy of a table on disk
- CA screen in the database client for browsing tables
- DA stored query that behaves like a virtual table
7.Hard
What is a phantom read?
- AReading uncommitted changes
- BA query that returns no rows
- CA repeated query returns new rows inserted by another committed transaction
- DReading data that was never written
8.Hard
Table employee(emp_id, dept_id, dept_name) has the key emp_id, and dept_id → dept_name. Which statement is correct?
- AIt is in BCNF and therefore in 3NF
- BIt is not in 1NF
- CIt is in 2NF but not in 3NF
- DIt is not in 2NF
Answer key
- 1. B · WHERE
- 2. C · No two rows have the same non-NULL value in that column
- 3. B · A column or set of columns that uniquely identifies each row
- 4. D · A named temporary result that can be used within one statement
- 5. D · Choosing which columns appear in the result
- 6. D · A stored query that behaves like a virtual table
- 7. C · A repeated query returns new rows inserted by another committed transaction
- 8. C · It is in 2NF but not in 3NF
Full step-by-step solutions: practise this topic on examproblems.com.