15 questions · 24 marks · 40 minutes. Negative marking on MCQ only: −1/3 mark for a wrong 1-mark MCQ, −2/3 for a wrong 2-mark MCQ. No negative marking for MSQ or NAT; MSQ has no partial credit.
Q1 · NAT · 1 mark(s) — Degree
A relation has attributes (a, b, c, d) and 50 tuples. What is its degree?
Numerical answer: ________
Q2 · MCQ · 1 mark(s) — Properties
Which is true in the relational model?
- (A) Every value is atomic or NULL
- (B) A relation may contain duplicate tuples
- (C) Attributes must have numeric domains
- (D) Tuples are ordered by primary key
Q3 · NAT · 2 mark(s) — NULL
Column x: 3, NULL, 3, 8, NULL, 1. How many rows satisfy NOT (x = 3)? (NOT of UNKNOWN is UNKNOWN.)
Numerical answer: ________
Q4 · NAT · 2 mark(s) — Superkeys
R(A, B, C, D, E, F) has candidate keys {A, B} and {A, C}. How many superkeys?
Numerical answer: ________
Q5 · MCQ · 2 mark(s) — Keys
Instance of R(A, B, C): (1, a, x), (2, a, y), (3, b, x), (4, b, y). Which can be a candidate key based on this instance?
- (A) {B}
- (B) {C}
- (C) {B, C}
- (D) {A, B}
Q6 · MSQ · 2 mark(s) — Foreign keys
Which are allowed for a foreign key FK in R₁ referencing R₂'s primary key?
- (A) An FK value missing from R₂
- (B) The same FK value in many tuples of R₁
- (C) FK referencing R₁ itself
- (D) FK value NULL (FK not part of R₁'s PK)
Q7 · MCQ · 1 mark(s) — Constraints
Updating the cgpa of a student (non-key, non-FK) can violate:
- (A) domain constraint
- (B) key constraint
- (C) entity integrity
- (D) referential integrity
Q8 · MSQ · 2 mark(s) — Constraints
Which operations can never violate referential integrity?
- (A) Inserting into the referencing relation
- (B) Inserting into the referenced relation
- (C) Deleting from the referenced relation
- (D) Deleting from the referencing relation
Q9 · NAT · 2 mark(s) — Cascade
R(A, B) with B → R.A ON DELETE CASCADE: (1, NULL), (2, 1), (3, 1), (4, 2), (5, 4), (6, 3), (7, NULL), (8, 7). Delete A = 2. How many tuples remain?
Numerical answer: ________
Q10 · MCQ · 2 mark(s) — Set null
Same R but ON DELETE SET NULL. Delete A = 1. Which tuples change?
- (A) (2, 1) and (3, 1) become (2, NULL) and (3, NULL)
- (B) (2, 1), (3, 1), (4, 2), (6, 3) all change
- (C) all tuples are deleted
- (D) nothing; the delete is rejected
Q11 · MCQ · 1 mark(s) — Mapping
A composite attribute is mapped to:
- (A) a foreign key
- (B) a separate table
- (C) its simple components as columns
- (D) a multivalued column
Q12 · NAT · 1 mark(s) — Minimum tables
E1 —M:N— E2, where E1 has 1 multivalued attribute. Minimum tables?
Numerical answer: ________
Q13 · NAT · 2 mark(s) — Minimum tables
E1 —1:N— E2 —1:1 (both total)— E3, E2 is a weak entity owned by E1 through the 1:N relationship. Minimum tables?
Numerical answer: ________
Q14 · MCQ · 2 mark(s) — Ternary
A ternary relationship R(E1, E2, E3) with all sides many and no attributes needs:
- (A) one table whose PK is the three keys together
- (B) no table; FKs are added to the entity tables
- (C) one table whose PK is E1's key
- (D) three tables, one per pair
Q15 · MCQ · 1 mark(s) — Specialisation
A total, disjoint specialisation of ACCOUNT into SAVINGS and CURRENT can be mapped without NULLs and without a superclass table using:
- (A) one table with flags
- (B) superclass table only
- (C) one table with a type attribute
- (D) subclass tables only
✓Answer Vault
Reveal answers when you’re ready
Q1 Answer: 4 · 1 mark(s)
Four attributes.
Re-read: Lesson 2.1.1 — Relation, tuple, attribute, domain, degree, cardinality, schema; properties of relations
Q2 Answer: (A) · 1 mark(s)
Atomic values (1NF), NULL allowed outside the PK.
- (B) is wrong: No duplicates.
- (C) is wrong: Any domain.
- (D) is wrong: No order.
Re-read: Lesson 2.1.1 — Relation, tuple, attribute, domain, degree, cardinality, schema; properties of relations
Q3 Answer: 2 · 2 mark(s)
x = 3 is FALSE for 8 and 1 → NOT gives TRUE for 2 rows; NULL rows stay UNKNOWN.
Re-read: Lesson 2.1.2 — NULL: meaning and basic behaviour
Q4 Answer: 24 · 2 mark(s)
Contain AB: 2⁴ = 16; contain AC: 16; contain ABC: 2³ = 8. 16 + 16 − 8 = 24.
Re-read: Lesson 2.2.1 — Superkey, candidate key, primary key, alternate key; counting superkeys
Q5 Answer: (C) · 2 mark(s)
B and C each repeat; (B, C) pairs are all different. {A, B} is unique but not minimal if {A} is unique ({A} is unique here).
- (A) is wrong: Repeats.
- (B) is wrong: Repeats.
- (D) is wrong: Contains {A}, which is already unique here, so {A, B} is not minimal.
Re-read: Lesson 2.2.1 — Superkey, candidate key, primary key, alternate key; counting superkeys
Q6 Answer: (B) (C) (D) · 2 mark(s)
Only dangling references are forbidden.
- (A) is wrong: Violates referential integrity.
Re-read: Lesson 2.2.2 — Foreign key; referencing vs referenced relations
Q7 Answer: (A) · 1 mark(s)
Only domain.
- (B) is wrong: Not a key.
- (C) is wrong: Not the PK.
- (D) is wrong: Not an FK.
Re-read: Lesson 2.3.1 — Domain, key, entity and referential integrity; which operations violate what
Q8 Answer: (B) (D) · 2 mark(s)
New parents and removed children are always safe.
- (A) is wrong: The new FK may match nothing.
- (C) is wrong: Children may be orphaned.
Re-read: Lesson 2.3.1 — Domain, key, entity and referential integrity; which operations violate what
Q9 Answer: 5 · 2 mark(s)
2 → 4 → 5 deleted. 8 − 3 = 5.
Re-read: Lesson 2.3.2 — Referential actions: restrict, cascade, set null; tracing cascading deletes
Q10 Answer: (A) · 2 mark(s)
Only direct children are changed.
- (B) is wrong: 4 and 6 still refer to existing tuples.
- (C) is wrong: That is cascade.
- (D) is wrong: That is restrict.
Re-read: Lesson 2.3.2 — Referential actions: restrict, cascade, set null; tracing cascading deletes
Q11 Answer: (C) · 1 mark(s)
Flatten.
- (A) is wrong: No.
- (B) is wrong: Only multivalued attributes need tables.
- (D) is wrong: Not allowed.
Re-read: Lesson 2.4.1 — Mapping strong and weak entities, composite and multivalued attributes
Q12 Answer: 4 · 1 mark(s)
E1, E2, R, multivalued.
Re-read: Lesson 2.4.2 — Mapping 1:1, 1:N, M:N with participation; minimum number of tables
Q13 Answer: 2 · 2 mark(s)
E1 (1). E2 and E3 merge (1:1 both total) into one table that also holds E1's key: 2.
Re-read: Lesson 2.4.2 — Mapping 1:1, 1:N, M:N with participation; minimum number of tables
Q14 Answer: (A) · 2 mark(s)
All keys form the PK.
- (B) is wrong: Cannot be stored as FKs.
- (C) is wrong: Not unique.
- (D) is wrong: Pairwise tables lose the three-way meaning.
Re-read: Lesson 2.4.3 — Ternary relationships; specialization/generalization mapping
Q15 Answer: (D) · 1 mark(s)
Total: nobody is lost; disjoint: nobody repeated.
- (A) is wrong: NULLs.
- (B) is wrong: Loses subclass attributes.
- (C) is wrong: NULLs in subclass columns.
Re-read: Lesson 2.4.3 — Ternary relationships; specialization/generalization mapping