1.Easy
GRANT and REVOKE belong to which part of SQL?
- AData Query Language (DQL)
- BData Manipulation Language (DML)
- CData Control Language (DCL)
- DData Definition Language (DDL)
2.Easy
What does a UNIQUE constraint on a column guarantee?
- AThe column cannot be changed after insert
- BNo two rows have the same non-NULL value in that column
- CThe column automatically becomes the primary key of the table
- DThe column values are sorted
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
- BZero-to-zero
- COne-to-one
- DOne-to-many
4.Medium
Second normal form (2NF) removes:
- AForeign keys
- BPartial dependencies of non-key columns on part of a composite key
- CTransitive dependencies between non-key columns via another non-key column
- DAll NULL values
5.Medium
Why can a table have only one clustered index?
- AClustered indexes can only be on the primary key
- BClustered indexes use too much memory
- CThe SQL standard forbids more than one index on a table
- DThe rows can be stored physically in only one order
6.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
7.Hard
Table enrolment(student_id, course_id, student_name, grade) has the key (student_id, course_id). Which normal form does it violate?
- ASecond normal form, because student_name depends on student_id only
- BNone, it is in BCNF
- CThird normal form only, because grade depends on student_name
- DFirst normal form, because the grade column does not hold atomic values
8.Hard
Boyce–Codd normal form (BCNF) requires that for every non-trivial functional dependency X → Y:
- AX contains NULL
- BY is a primary key
- CX is a superkey
- DY is atomic
Answer key
- 1. C · Data Control Language (DCL)
- 2. B · No two rows have the same non-NULL value in that column
- 3. D · One-to-many
- 4. B · Partial dependencies of non-key columns on part of a composite key
- 5. D · The rows can be stored physically in only one order
- 6. A · With a junction table holding foreign keys to both students and courses
- 7. A · Second normal form, because student_name depends on student_id only
- 8. C · X is a superkey
Full step-by-step solutions: practise this topic on examproblems.com.