For teachers: free to print, copy and use in class. Every new worksheet has new values and its own answer key. A link to ExamProblems on your course page is appreciated.
Name: ____________________ Date: ____________
1.Easy
What does NULL represent in SQL?
AA missing or unknown value
BA false Boolean
CThe number zero in numeric columns
DAn empty string
2.Easy
What does COMMIT do in a transaction?
ALocks the whole database
BStarts a new table
CMakes all changes of the transaction permanent
DUndoes all changes made since the transaction began
3.Easy
What is a composite key?
AA key that allows duplicate values
BA key made up of two or more columns
CA key stored in a separate table
DA key that is generated by the database
4.Medium
What does EXCEPT (called MINUS in Oracle) return?
ARows that appear in both queries
BRows of the first query that do not appear in the second
CAll rows from both queries without duplicates
DRows of the second query that do not appear in the first one
5.Medium
What does SELECT COALESCE(phone, 'unknown') FROM customers return for a customer whose phone is NULL?
A'unknown'
BAn empty string
CAn error
DNULL
6.Medium
In relational algebra, the projection operator (π) corresponds to:
ACombining two tables on a key
BChoosing which columns appear in the result
CSorting the result
DChoosing which rows satisfy a given condition
7.Hard
Which window function assigns 1, 2, 3, ... to rows within each partition without ties?
ACOUNT()
BROW_NUMBER()
CRANK()
DDENSE_RANK()
8.Hard
When is a schedule of concurrent transactions called serializable?
AWhen the transactions run on one CPU only
BWhen its effect is equivalent to some serial execution of the same transactions
CWhen no transaction ever reads data
DWhen every transaction is given a serial number
Answer key
1. A · A missing or unknown value
2. C · Makes all changes of the transaction permanent
3. B · A key made up of two or more columns
4. B · Rows of the first query that do not appear in the second
5. A · 'unknown'
6. B · Choosing which columns appear in the result
7. B · ROW_NUMBER()
8. B · When its effect is equivalent to some serial execution of the same transactions
Full step-by-step solutions: practise this topic on examproblems.com.