a) Find all the 4NF violations:
a) R(A, B, C, D) with MVD's A →→ B and A →→ C:
Violating 4NF dependency: A →→ B and A →→ C
b) R(A, B, C, D) with MVD's A →→ B and B →→ CD:
Violating 4NF dependency: A →→ B
c) R(A, B, C, D) with MVD AB →→ C and FD B → D:
No 4NF violations.
d) R(A, B, C, D, E) with MVD's A →→ B and AB →→ C and FD's A → D and AB → E:
Violating 4NF dependency: A →→ B and AB →→ C
b) Decompose the relations into a collection of relation schemas in 4NF:
a) R1(A, B, C, D) --> R1(A, B), R2(A, C)
b) R2(A, B, C, D) --> R3(A, B), R4(B, C, D)
c) R3(A, B, C, D) --> No decomposition, already in 4NF
d) R4(A, B, C, D, E) --> R5(A, B), R6(A, B, C), R7(A, D), R8(A, B, E)
- Using the chase test:
a) A → D:
- start with t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- apply B → D: t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- cannot make target tuples equal, so the dependency A → D does not hold
b) A →→ D:
- start with t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- apply B → D: t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- violated the condition A →→ D, so it does not hold
c) A → E:
- start with t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- apply B → D: t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- apply C →→ E: t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- since target tuples are equal, the dependency A → E holds
d) A →→ E:
- start with t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- apply B → D: t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- apply C →→ E: t1[A=1,B=C,D,E=1] and t2[A=2,B=C,D,E=2]
- since target tuples are equal, the dependency A →→ E holds
-
If we project the relation R of Problem 3 onto S(A, C, E), the nontrivial FD's and MVD's that hold in S are:
-
a) The Union Rule:
Proof: If X →→ Y and X →→ Z are given, we need to show X →→ (Y ∪ Z) holds.
By definition of MVD, if X →→ Y and X →→ Z, we have:
* XY and XZ are in R.
* These two tuples agree on X.
If these two tuples also agree on (Y ∪ Z), then we can conclude that X →→ (Y ∪ Z) holds.
b) The Intersection Rule:
Proof: If X →→ Y and X →→ Z are given, we need to show X →→ (Y ∩ Z) holds.
By definition of MVD, if X →→ Y and X →→ Z, we have:
* XY and XZ are in R.
* These two tuples agree on X.
If these two tuples also agree on (Y ∩ Z), then we can conclude that X →→ (Y ∩ Z) holds.
c) The Difference Rule:
Proof: If X →→ Y and X →→ Z are given, we need to show X →→ (Y - Z) holds.
By definition of MVD, if X →→ Y and X →→ Z, we have:
* XY and XZ are in R.
* These two tuples agree on X.
If these two tuples also agree on (Y - Z), then we can conclude that X →→ (Y - Z) holds.
d) Removing attributes shared by left and right side:
Proof: If X →→ Y holds, we need to show X →→ (Y - X) holds.
By definition of MVD, if X →→ Y, we have:
* XY is in R.
Since we are removing the common attributes between X and Y, any tuple that agrees on X must also agree on (Y - X), so X →→ (Y - X) holds.
-
a) A dense index: ceil(n/3)
b) A sparse index: ceil(n/10)
-
a) A dense index: ceil(0.8n/30)
b) A sparse index: ceil(0.8n/200)
-
a) n = 10:
i) Interior nodes: minimum 5 keys and 6 pointers
ii) Leaves: minimum 5 keys
b) n = 11:
i) Interior nodes: minimum 6 keys and 7 pointers
ii) Leaves: minimum 6 keys