1.Easy
What is a candidate key?
- AA column that is waiting to become a foreign key
- BA set of columns shared between two tables to link their rows
- CA minimal set of columns that uniquely identifies each row
- DAny column that contains NULL values
2.Easy
GRANT and REVOKE belong to which part of SQL?
- AData Control Language (DCL)
- BData Query Language (DQL)
- CData Definition Language (DDL)
- DData Manipulation Language (DML)
3.Easy
What does WHERE country IN ('NL', 'BE', 'DE') do?
- AKeeps rows whose country value contains all three codes at once
- BSorts rows in the order of the list
- CKeeps rows whose country equals any value in the list
- DKeeps rows whose country is not in the list
4.Medium
In relational algebra, the selection operator (σ) corresponds to which SQL clause?
- ASELECT list
- BWHERE
- CORDER BY
- DGROUP BY
5.Medium
In relational algebra, the projection operator (π) corresponds to:
- AChoosing which rows satisfy a given condition
- BChoosing which columns appear in the result
- CSorting the result
- DCombining two tables on a key
6.Medium
What does EXCEPT (called MINUS in Oracle) return?
- AAll rows from both queries without duplicates
- BRows of the first query that do not appear in the second
- CRows of the second query that do not appear in the first one
- DRows that appear in both queries
7.Hard
What is a covering index for a query?
- AAn index on the primary key only
- BAn index that is rebuilt every night
- CAn index that covers every column of every table
- DAn index that contains all columns the query needs, so the table itself need not be read
8.Hard
x is NULL and y = 1. What is the value of the condition (x > 5 OR y = 1)?
- ANULL, so the row is always rejected
- BFALSE
- CTRUE
- DUNKNOWN
Answer key
- 1. C · A minimal set of columns that uniquely identifies each row
- 2. A · Data Control Language (DCL)
- 3. C · Keeps rows whose country equals any value in the list
- 4. B · WHERE
- 5. B · Choosing which columns appear in the result
- 6. B · Rows of the first query that do not appear in the second
- 7. D · An index that contains all columns the query needs, so the table itself need not be read
- 8. C · TRUE
Full step-by-step solutions: practise this topic on examproblems.com.