A relation R(A, B, C, D) has functional dependencies A->B, B->C, C->D.
Which of the following is a lossless-join, dependency-preserving 3NF
decomposition of R?
A. R1(A, B), R2(B, C), R3(C, D)
B. R1(A, B), R2(B, C, D)
C. R1(A, B), R2(A, C), R3(C, D)
D. R1(A, B, C), R2(C, D)
Correct Answer: A - R1(A, B), R2(B, C), R3(C, D)
RATIONALE
The decomposition into R1(A,B), R2(B,C), R3(C,D) is lossless
(common attributes are keys) and preserves all FDs. Option B loses
A->B? No, it preserves B->C and C->D but loses A->B? Actually
R2(B,C,D) preserves B->C, C->D, but A->B is lost. Option C is
lossless but not dependency-preserving because B->C is not
preserved. Option D is lossless but loses A->B? R1(A,B,C) preserves
A->B, B->C; R2(C,D) preserves C->D, but the join of R1 and R2 is
lossless? Common attribute C is key of R2? C is not a key of R2?
R2(C,D) has C as key only if C->D, yes C is key, so lossless. But
dependency preservation? A->B, B->C, C->D are all preserved? A->B
in R1, B->C in R1, C->D in R2, so it is dependency-preserving.
However, the question asks for a 3NF decomposition; option D is also
3NF? R1(A,B,C) has candidate key A, and B,C are non-prime; but
B->C is a transitive dependency? Actually A->B, B->C, so B is not a
superkey, so R1 is not in 3NF. Thus D is not 3NF. Option A is correct.
Question 2
In a database using multiversion concurrency control (MVCC), a transaction
T1 reads a data item X that was written by an uncommitted transaction T2.
Which isolation level is most likely in effect?
A. READ UNCOMMITTED
B. READ COMMITTED
Page 2
, C. REPEATABLE READ
D. SERIALIZABLE
Correct Answer: A - READ UNCOMMITTED
RATIONALE
READ UNCOMMITTED allows dirty reads, so T1 can read
uncommitted data from T2. READ COMMITTED prevents dirty
reads by only allowing reads of committed data. REPEATABLE
READ and SERIALIZABLE also prevent dirty reads. Thus, the
scenario indicates READ UNCOMMITTED.
Question 3
Which of the following SQL statements correctly retrieves the names of
customers who have placed more than 5 orders, using a correlated subquery?
A. SELECT c.name FROM Customers c WHERE (SELECT COUNT(*)
FROM Orders o WHERE o.customer_id = c.id) > 5;
B. SELECT c.name FROM Customers c WHERE COUNT(SELECT *
FROM Orders o WHERE o.customer_id = c.id) > 5;
C. SELECT c.name FROM Customers c JOIN Orders o ON c.id =
o.customer_id GROUP BY c.name HAVING COUNT(*) > 5;
D. SELECT c.name FROM Customers c WHERE EXISTS (SELECT *
FROM Orders o WHERE o.customer_id = c.id AND COUNT(*) > 5);
Correct Answer: A - SELECT c.name FROM Customers c
WHERE (SELECT COUNT(*) FROM Orders o WHERE
o.customer_id = c.id) > 5;
RATIONALE
Option A uses a correlated subquery to count orders per customer and
filters those with more than 5. Option B is syntactically invalid.
Option C uses a join and GROUP BY, which is not a correlated
subquery. Option D uses EXISTS with an aggregate, which is invalid.
Thus, A is correct.
Page 3
, Question 4
In a star schema, which of the following best describes the role of a degenerate
dimension?
A. A dimension key that is stored in the fact table but has no
corresponding dimension table.
B. A dimension that is snowflaked into multiple tables.
C. A dimension that contains only one attribute.
D. A dimension that is shared across multiple fact tables.
Correct Answer: A - A dimension key that is stored in the fact
table but has no corresponding dimension table.
RATIONALE
A degenerate dimension is a dimension key (like an invoice number)
that remains in the fact table without its own dimension table. It is not
snowflaked, not necessarily single-attribute, and not about sharing
across fact tables. Thus, A is correct.
Question 5
A database administrator needs to ensure that a transaction's updates are
durable even if the system crashes immediately after commit. Which
mechanism is primarily responsible for this?
A. Write-ahead logging (WAL)
B. Two-phase locking (2PL)
C. Shadow paging
D. Checkpointing
Correct Answer: A - Write-ahead logging (WAL)
Page 4