1.Easy
An INNER JOIN returns:
- AAll rows from the left table, with NULLs where there is no match
- BRows that do not match
- CAll rows from both tables
- DOnly rows with matching values in both tables
2.Easy
Which statement deletes a whole table, including its structure?
- ATRUNCATE ROWS
- BDROP TABLE
- CREMOVE TABLE
- DDELETE FROM
3.Easy
Which aggregate function counts rows?
- ASUM
- BAVG
- CCOUNT
- DMAX
4.Medium
A LEFT JOIN returns:
- AAll rows from the left table and matching rows from the right, with NULLs where there is no match
- BRows that match in neither table
- COnly matching rows from both tables
- DAll rows from the right table only
5.Medium
Students can take many courses and courses have many students. How is this modelled in tables?
- AWith a junction table holding foreign keys to both students and courses
- BWith a foreign key column course_id in the students table pointing to courses
- CBy merging students and courses into one table
- DWith a list of course ids stored in one column
6.Medium
Second normal form (2NF) removes:
- APartial dependencies of non-key columns on part of a composite key
- BForeign keys
- CAll NULL values
- DTransitive dependencies between non-key columns via another non-key column
7.Hard
With multiversion concurrency control (MVCC), how can readers avoid blocking writers?
- AWriters are not allowed while any reader is active
- BReaders see a consistent snapshot of committed row versions while writers create new versions
- CReaders read uncommitted data directly
- DReaders always wait until all writers have committed
8.Hard
R(A, B, C, D) has the functional dependencies A → B and C → D. What is the candidate key?
- A{A}
- B{C}
- C{A, C}
- D{B, D}
Answer key
- 1. D · Only rows with matching values in both tables
- 2. B · DROP TABLE
- 3. C · COUNT
- 4. A · All rows from the left table and matching rows from the right, with NULLs where there is no match
- 5. A · With a junction table holding foreign keys to both students and courses
- 6. A · Partial dependencies of non-key columns on part of a composite key
- 7. B · Readers see a consistent snapshot of committed row versions while writers create new versions
- 8. C · {A, C}
Full step-by-step solutions: practise this topic on examproblems.com.