Third mixed set. Same running data as Set 1.
12 questions · 20 marks · 35 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 · MCQ · 1 mark(s) — (min,max)
WORKS_IN(EMPLOYEE, DEPT) shows EMPLOYEE (1, 1) and DEPT (0, N). Which is true?
- (A) Every employee works in exactly one department; a department may have none.
- (B) Every department has at least one employee.
- (C) The relationship is M:N.
- (D) An employee may work in many departments.
Q2 · NAT · 2 mark(s) — ER mapping
EMPLOYEE has a recursive 1:N relationship SUPERVISES and a 1:1 relationship (both total) with PARKING_SPOT. How many tables at minimum?
Numerical answer: ________
Q3 · NAT · 2 mark(s) — Outer join + NULL
SELECT COUNT(*) FROM STUDENT S LEFT JOIN ENROLL E ON S.roll = E.roll WHERE E.grade IS NULL OR E.grade <> 'A';
Numerical answer: ________
Q4 · NAT · 1 mark(s) — INTERSECT
How many rows: SELECT roll FROM ENROLL INTERSECT SELECT roll FROM STUDENT WHERE dept = 'CS';
Numerical answer: ________
Q5 · MCQ · 2 mark(s) — Aggregates
SELECT dept, AVG(cgpa) FROM STUDENT GROUP BY dept HAVING COUNT(*) > COUNT(cgpa); returns:
- (A) no rows
- (B) (CS, 8.75)
- (C) (CS, 5.83)
- (D) (CS, 8.75), (EE, 7.8)
Q6 · MCQ · 2 mark(s) — Normal forms
R(A, B, C, D, E), F = {AB → C, C → D, D → A}. Highest normal form?
- (A) 1NF
- (B) 2NF
- (C) BCNF
- (D) 3NF
Q7 · NAT · 2 mark(s) — 3NF synthesis
How many relations does 3NF synthesis produce for R(A, B, C, D, E, F) with F = {A → B, C → D, E → F, AC → E}?
Numerical answer: ________
Q8 · NAT · 1 mark(s) — Spanned blocks
r = 80,000 records, R = 300 bytes, B = 4096, spanned. Number of blocks?
Numerical answer: ________
Q9 · NAT · 2 mark(s) — B+ capacity
A B+ tree has internal order p = 50 and leaf order p_leaf = 40. Maximum records with 3 levels?
Numerical answer: ________
Q10 · MCQ · 2 mark(s) — Serializability
S = R3(X) R2(X) W3(X) R1(X) W1(X). Equivalent serial order?
- (A) T2, T3, T1
- (B) T3, T2, T1
- (C) T1, T2, T3
- (D) not CS
Q11 · MCQ · 1 mark(s) — Thomas rule
TS(T) = 8, RTS(X) = 5, WTS(X) = 12. T issues write(X). With the Thomas write rule:
- (A) T waits
- (B) the write is ignored
- (C) the write executes
- (D) T aborts
Q12 · MSQ · 2 mark(s) — Recovery
Immediate update. Log: ⟨T1 start⟩ ⟨T1, A, 1, 2⟩ ⟨T1 commit⟩ ⟨checkpoint⟩ ⟨T2 start⟩ ⟨T2, B, 3, 4⟩ ⟨T3 start⟩ ⟨T3, A, 2, 7⟩ ⟨T3 commit⟩ — crash. Which actions are needed?
- (A) Redo T3
- (B) Undo T2
- (C) Undo T3
- (D) Redo T1
✓Answer Vault
Reveal answers when you’re ready
Q1 Answer: (A) · 1 mark(s)
Each pair counts its own entity's links.
- (B) is wrong: DEPT's min is 0.
- (C) is wrong: It is N:1.
- (D) is wrong: EMPLOYEE's max is 1.
Re-read: Lesson 1.2.2 — Cardinality ratios; total vs partial participation; (min,max) notation
Q2 Answer: 1 · 2 mark(s)
Supervisor id as an FK inside EMPLOYEE; PARKING_SPOT merges with EMPLOYEE (1:1 both total).
Re-read: Lesson 2.4.2 — Mapping 1:1, 1:N, M:N with participation; minimum number of tables
Q3 Answer: 5 · 2 mark(s)
Non-A rows: (1, C2, B), (2, C3, B), (3, C1, B), (4, C4, C), plus Esha's padded row.
Re-read: Lesson 3.3.6 — Joins in SQL: INNER, NATURAL, LEFT/RIGHT/FULL OUTER
Q4 Answer: 2 · 1 mark(s)
Rolls 1 and 3 (Esha has no enrolment).
Re-read: Lesson 3.3.7 — UNION / INTERSECT / EXCEPT and their ALL variants
Q5 Answer: (B) · 2 mark(s)
Only CS has a NULL cgpa; AVG ignores it: (9.1 + 8.4)/2.
- (A) is wrong: CS qualifies.
- (C) is wrong: That divides by 3.
- (D) is wrong: EE has no NULL.
Re-read: Lesson 3.3.5 — Aggregates, GROUP BY, HAVING; COUNT(*) vs COUNT(col); NULL handling
Q6 Answer: (D) · 2 mark(s)
Keys ABE, BCE, BDE: every attribute is prime. C → D has a non-superkey left side.
- (A) is wrong: Higher.
- (B) is wrong: Higher.
- (C) is wrong: C is not a superkey.
Re-read: Lesson 4.4.3 — 3NF (transitive dependency + formal condition)
Q7 Answer: 4 · 2 mark(s)
Minimal cover = F; tables AB, CD, EF, ACE. ACE contains the key AC: no extra table.
Re-read: Lesson 4.4.6 — Algorithms: 3NF synthesis, BCNF decomposition
Q8 Answer: 5860 · 1 mark(s)
⌈24,000,000 / 4096⌉ = ⌈5859.4⌉.
Re-read: Lesson 5.1.1 — Storage basics: disk, blocks, block access cost, records, blocking factor, spanned vs unspanned
Q9 Answer: 100000 · 2 mark(s)
50² × 40.
Re-read: Lesson 5.6.2 — B+ tree order from block size, key size and pointer size
Q10 Answer: (A) · 2 mark(s)
R2(X) before W3(X) and W1(X): T2 → T3, T2 → T1. W3(X) before R1(X): T3 → T1.
- (B) is wrong: T2 must precede T3.
- (C) is wrong: Reversed.
- (D) is wrong: Acyclic.
Re-read: Lesson 6.4.2 — Conflict serializability: conflicting ops, precedence graph, equivalent serial orders
Q11 Answer: (B) · 1 mark(s)
TS < WTS but ≥ RTS: obsolete write.
- (A) is wrong: TO never waits.
- (C) is wrong: Breaks timestamp order.
- (D) is wrong: Basic TO.
Re-read: Lesson 6.7.1 — Timestamp ordering protocol; Thomas write rule
Q12 Answer: (A) (B) · 2 mark(s)
T1 committed before the checkpoint: nothing. T2 uncommitted: undo. T3 committed after the checkpoint: redo.
- (C) is wrong: T3 committed.
- (D) is wrong: Before the checkpoint.
Re-read: Lesson 6.8.1 — Multiple granularity, validation-based protocol, log-based recovery