1.Easy
Which SQL statement changes values in rows that already exist?
- AINSERT
- BREPLACE COLUMN
- CMODIFY
- DUPDATE
2.Easy
What is a primary key?
- AA column that may hold duplicate values but must never contain NULL
- BA column or set of columns that uniquely identifies each row
- CA password for the database
- DThe first column of every table
3.Easy
A customer can place many orders, but each order belongs to exactly one customer. What type of relationship is this?
- AMany-to-many
- BOne-to-many
- CZero-to-zero
- DOne-to-one
4.Medium
Which query returns the number of different cities in the customers table?
- ASELECT SUM(DISTINCT city) FROM customers
- BSELECT DISTINCT COUNT(city) FROM customers
- CSELECT COUNT(city) FROM customers GROUP BY city
- DSELECT COUNT(DISTINCT city) FROM customers
5.Medium
Which query returns the highest salary in each department?
- ASELECT MAX(dept), salary FROM emp GROUP BY salary
- BSELECT dept, salary FROM emp WHERE salary = MAX(salary)
- CSELECT dept, MAX(salary) FROM emp GROUP BY dept
- DSELECT dept, MAX(salary) FROM emp ORDER BY dept
6.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
7.Hard
R(A, B, C, D) has the functional dependencies A → B and C → D. What is the candidate key?
- A{A, C}
- B{A}
- C{B, D}
- D{C}
8.Hard
What is a known drawback of decomposing tables into BCNF compared with 3NF?
- ABCNF allows more redundancy than 3NF
- BBCNF tables cannot have primary keys
- CSome functional dependencies may no longer be checkable within a single table
- DThe decomposition always loses data when joined back
Answer key
- 1. D · UPDATE
- 2. B · A column or set of columns that uniquely identifies each row
- 3. B · One-to-many
- 4. D · SELECT COUNT(DISTINCT city) FROM customers
- 5. C · SELECT dept, MAX(salary) FROM emp GROUP BY dept
- 6. C · Rows of the first query that do not appear in the second
- 7. A · {A, C}
- 8. C · Some functional dependencies may no longer be checkable within a single table
Full step-by-step solutions: practise this topic on examproblems.com.