1.Easy
What is a candidate key?
- AA minimal set of columns that uniquely identifies each row
- BA column that is waiting to become a foreign key
- CA set of columns shared between two tables to link their rows
- DAny column that contains NULL values
2.Easy
Which SQL statement retrieves data from a table?
- AUPDATE
- BINSERT
- CCREATE
- DSELECT
3.Easy
Which keyword gives a column or table a temporary alternative name in a query?
- ARENAME
- BAS
- CNAME
- DALIAS
4.Medium
What does EXCEPT (called MINUS in Oracle) return?
- AAll rows from both queries without duplicates
- BRows that appear in both queries
- CRows of the first query that do not appear in the second
- DRows of the second query that do not appear in the first one
5.Medium
In relational algebra, the selection operator (σ) corresponds to which SQL clause?
- AWHERE
- BORDER BY
- CGROUP BY
- DSELECT list
6.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
7.Hard
Transaction T1 locks row A and waits for row B, while T2 locks row B and waits for row A. What does a typical DBMS do?
- ADetects the deadlock and aborts one transaction as the victim
- BMerges the two transactions into one
- CLets both transactions wait until one of them commits normally
- DCommits both transactions at once
8.Hard
Two transactions both read stock = 10, each subtracts 1 and writes the result, giving 9 instead of 8. Which anomaly is this?
- APhantom read
- BDirty read
- CLost update
- DDeletion anomaly
Answer key
- 1. A · A minimal set of columns that uniquely identifies each row
- 2. D · SELECT
- 3. B · AS
- 4. C · Rows of the first query that do not appear in the second
- 5. A · WHERE
- 6. D · A stored query that behaves like a virtual table
- 7. A · Detects the deadlock and aborts one transaction as the victim
- 8. C · Lost update
Full step-by-step solutions: practise this topic on examproblems.com.