1.Easy
How does UNION ALL differ from UNION?
- AUNION ALL removes duplicate rows
- BUNION ALL sorts the result
- CUNION ALL keeps duplicate rows
- DUNION ALL only works on one table
2.Easy
What is a candidate key?
- AA set of columns shared between two tables to link their rows
- BA column that is waiting to become a foreign key
- CA minimal set of columns that uniquely identifies each row
- DAny column that contains NULL values
3.Easy
What does a UNIQUE constraint on a column guarantee?
- AThe column automatically becomes the primary key of the table
- BThe column cannot be changed after insert
- CNo two rows have the same non-NULL value in that column
- DThe column values are sorted
4.Medium
Students can take many courses and courses have many students. How is this modelled in tables?
- ABy merging students and courses into one table
- BWith a foreign key column course_id in the students table pointing to courses
- CWith a list of course ids stored in one column
- DWith a junction table holding foreign keys to both students and courses
5.Medium
What does EXCEPT (called MINUS in Oracle) return?
- AAll rows from both queries without duplicates
- 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
- DRows that appear in both queries
6.Medium
Which ACID property guarantees that committed changes survive a system crash?
- AConsistency
- BIsolation
- CDurability
- DAtomicity
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?
- ANULL
- B10
- CAn error
- D0
8.Hard
There is a composite index on (last_name, first_name). Which condition can use it most effectively?
- AWHERE last_name = 'Jansen'
- BWHERE first_name = 'Eva'
- CWHERE UPPER(first_name) = 'EVA'
- DWHERE first_name LIKE '%a'
Answer key
- 1. C · UNION ALL keeps duplicate rows
- 2. C · A minimal set of columns that uniquely identifies each row
- 3. C · No two rows have the same non-NULL value in that column
- 4. D · With a junction table holding foreign keys to both students and courses
- 5. C · Rows of the first query that do not appear in the second
- 6. C · Durability
- 7. D · 0
- 8. A · WHERE last_name = 'Jansen'
Full step-by-step solutions: practise this topic on examproblems.com.