1.Easy
What is a surrogate key?
- AA key that refers to another table
- BA key made from real-world data such as an email address
- CAn artificial identifier with no business meaning, such as an auto-increment id
- DA key that is only used in views
2.Easy
Which keyword gives a column or table a temporary alternative name in a query?
- AAS
- BRENAME
- CNAME
- DALIAS
3.Easy
Which statement adds a new column to an existing table?
- ACREATE COLUMN
- BALTER TABLE
- CUPDATE TABLE
- DINSERT COLUMN
4.Medium
Which statement removes all rows of a table, keeps its structure and cannot take a WHERE clause?
- AALTER TABLE
- BTRUNCATE TABLE
- CDROP TABLE
- DDELETE FROM with a WHERE clause
5.Medium
In relational algebra, the projection operator (π) corresponds to:
- ACombining two tables on a key
- BSorting the result
- CChoosing which columns appear in the result
- DChoosing which rows satisfy a given condition
6.Medium
A view in SQL is:
- AAn index type
- BA stored query that behaves like a virtual table
- CA screen in the database client for browsing tables
- DA copy of a table on disk
7.Hard
Two-phase locking (2PL) ensures:
- AThat transactions never wait
- BThat deadlocks can never happen
- CThat no locks are needed
- DConflict-serializable schedules
8.Hard
Which window function assigns 1, 2, 3, ... to rows within each partition without ties?
- ARANK()
- BCOUNT()
- CDENSE_RANK()
- DROW_NUMBER()
Answer key
- 1. C · An artificial identifier with no business meaning, such as an auto-increment id
- 2. A · AS
- 3. B · ALTER TABLE
- 4. B · TRUNCATE TABLE
- 5. C · Choosing which columns appear in the result
- 6. B · A stored query that behaves like a virtual table
- 7. D · Conflict-serializable schedules
- 8. D · ROW_NUMBER()
Full step-by-step solutions: practise this topic on examproblems.com.