1.Easy
Which SQL statement changes values in rows that already exist?
- AUPDATE
- BINSERT
- CREPLACE COLUMN
- DMODIFY
2.Easy
Which aggregate function returns the average of a numeric column?
- AMEDIAN
- BMEAN
- CAVG
- DSUM
3.Easy
What does COMMIT do in a transaction?
- AStarts a new table
- BUndoes all changes made since the transaction began
- CLocks the whole database
- DMakes all changes of the transaction permanent
4.Medium
What does EXCEPT (called MINUS in Oracle) return?
- ARows that appear in both queries
- BRows of the second query that do not appear in the first one
- CRows of the first query that do not appear in the second
- DAll rows from both queries without duplicates
5.Medium
The orders table has 5 rows, each referring to an existing customer. The customers table has 3 rows. How many rows does an INNER JOIN on customer_id return?
- A5
- B8
- C3
- D15
6.Medium
Second normal form (2NF) removes:
- AAll NULL values
- BPartial dependencies of non-key columns on part of a composite key
- CTransitive dependencies between non-key columns via another non-key column
- DForeign keys
7.Hard
A correlated subquery is one that:
- AReferences columns of the outer query and is evaluated per outer row
- BRuns only once before the outer query and caches its result for every row
- CUses only aggregate functions
- DJoins two tables with a foreign key
8.Hard
R(A, B, C, D) has the functional dependencies A → B and C → D. What is the candidate key?
- A{A, C}
- B{C}
- C{A}
- D{B, D}
Answer key
- 1. A · UPDATE
- 2. C · AVG
- 3. D · Makes all changes of the transaction permanent
- 4. C · Rows of the first query that do not appear in the second
- 5. A · 5
- 6. B · Partial dependencies of non-key columns on part of a composite key
- 7. A · References columns of the outer query and is evaluated per outer row
- 8. A · {A, C}
Full step-by-step solutions: practise this topic on examproblems.com.