1.Easy
What does COMMIT do in a transaction?
- AStarts a new table
- BUndoes all changes made since the transaction began
- CMakes all changes of the transaction permanent
- DLocks the whole database
2.Easy
Which operator is used for simple text pattern matching in a WHERE clause?
- ALIKE
- BCONTAINS
- CSIMILAR
- DMATCH
3.Easy
Which aggregate function returns the average of a numeric column?
- ASUM
- BMEAN
- CAVG
- DMEDIAN
4.Medium
First normal form (1NF) requires that:
- AEvery non-key column depends on the whole key and on nothing but the key
- BEach column contains atomic values and there are no repeating groups
- CThere are no foreign keys
- DEvery table has exactly one column
5.Medium
A view in SQL is:
- AA screen in the database client for browsing tables
- BA copy of a table on disk
- CA stored query that behaves like a virtual table
- DAn index type
6.Medium
In relational algebra, the selection operator (σ) corresponds to which SQL clause?
- AGROUP BY
- BORDER BY
- CSELECT list
- DWHERE
7.Hard
Given the functional dependencies A → B, B → C and C → D on R(A, B, C, D), what is the closure A+?
- A{A, B}
- B{A, B, C}
- C{A}
- D{A, B, C, D}
8.Hard
Why is SELECT dept, name, COUNT(*) FROM emp GROUP BY dept invalid in standard SQL?
- Adept must appear inside an aggregate function
- BGROUP BY must list all columns of the table
- Cname is neither grouped nor aggregated, so it has no single value per group
- DCOUNT(*) cannot be used together with GROUP BY
Answer key
- 1. C · Makes all changes of the transaction permanent
- 2. A · LIKE
- 3. C · AVG
- 4. B · Each column contains atomic values and there are no repeating groups
- 5. C · A stored query that behaves like a virtual table
- 6. D · WHERE
- 7. D · {A, B, C, D}
- 8. C · name is neither grouped nor aggregated, so it has no single value per group
Full step-by-step solutions: practise this topic on examproblems.com.