1.Easy
How does UNION ALL differ from UNION?
- AUNION ALL keeps duplicate rows
- BUNION ALL removes duplicate rows
- CUNION ALL only works on one table
- DUNION ALL sorts the result
2.Easy
Which keyword gives a column or table a temporary alternative name in a query?
- AALIAS
- BRENAME
- CAS
- DNAME
3.Easy
How do you sort a result from the highest to the lowest salary?
- ASORT salary DOWN
- BORDER BY salary DESC
- CGROUP BY salary DESC
- DORDER BY salary ASC
4.Medium
What does EXCEPT (called MINUS in Oracle) return?
- ARows of the first query that do not appear in the second
- BRows of the second query that do not appear in the first one
- CRows that appear in both queries
- DAll rows from both queries without duplicates
5.Medium
What does the functional dependency A → B mean?
- AA and B are both primary keys
- BEach value of A is associated with exactly one value of B
- CEach value of B is associated with exactly one value of A
- DA is a foreign key referencing B
6.Medium
First normal form (1NF) requires that:
- AEach column contains atomic values and there are no repeating groups
- BEvery table has exactly one column
- CThere are no foreign keys
- DEvery non-key column depends on the whole key and on nothing but the key
7.Hard
What is the result of SELECT COUNT(col) FROM t if all values in col are NULL and the table has 10 rows?
- A0
- BNULL
- CAn error
- D10
8.Hard
x is NULL and y = 1. What is the value of the condition (x > 5 OR y = 1)?
- ATRUE
- BNULL, so the row is always rejected
- CFALSE
- DUNKNOWN
Answer key
- 1. A · UNION ALL keeps duplicate rows
- 2. C · AS
- 3. B · ORDER BY salary DESC
- 4. A · Rows of the first query that do not appear in the second
- 5. B · Each value of A is associated with exactly one value of B
- 6. A · Each column contains atomic values and there are no repeating groups
- 7. A · 0
- 8. A · TRUE
Full step-by-step solutions: practise this topic on examproblems.com.