Database Management Find min and max cardinality both in numbers and symbols for
ID: 3728945 • Letter: D
Question
Database Management
Find min and max cardinality both in numbers and symbols for the following queries EXERCISE R1(A, B, C), with foreign integrity constraint between C and R2, and having cardinality N1300 R2(D, E, F),, with foreign integrity constraint between E, F and R3, and having cardinality N2 = 100 R3(G, H, D, having cardinality N3= 200 3. R2 jOINE-GAF-HR3 4. PROJA,B (R1) 5. (R1 JOIN c-DR2) JOIN E-GR3 E-GAF-H R3) jOIN1-BRI Solution Example 7. PROJ B.c (R1) 8. R1 JOIN c DR2 9. R3 JOINRl Ex. Min Max Min Max (symb) (symb) (numb) (numb) N3 200Explanation / Answer
3. | R2 JOIN E=G / F=H R3| = 100 (because since R3 and E,F has foreign integrity constraint so each tuple in R2 is joined with unique tuple of R3 having E=G and F=H resulting in 100 cardinality.
4. | PROJA,B (R1) | = 300 (because all the tuples formed by A , B of R1 is unique resulting in cardinality of 300)
5. | R1 JOIN C=D R2| =300 (from part 8).
Now | (R1 JOIN C=D R2) JOINE=G R3| = 300 (because all the 300 unique tuples obtained from R1 JOIN C=DR2 will have its E value presnt in G.So it will result in 300 cardinality )
6. | R2 JOIN E=G / F=H R3| = 100 (from part 3)
Now | (R2 JOIN E=G / F=H R3) JOIN I=B R1| <= 100 (because the tuples formed by (R2 JOIN E=G / F=H R3) has no foreign integrity constraint with R1,so at max all the values of I is present in A ,in that case cardinality is 100.Otherwise it will be less than 100)
7. |PROJB,C (R1)| <=300 (because B and C are not the primary key so it might be possible that the tuple formed by B and C may be duplicate.). If all the tuples formed by B,C is same then the result have only 1 tuple.
8. | R1 JOIN C=D R2| =300 (because all the C's value is present in D because of foreighn integrity constraint.So each tuple in R1 will get joined to a unique tuple in R2 where value of C = value of D)
9. | R3 JOIN I=A R1| <=200 (because R1 and R3 has no foreign integrity constraint,so at max all the values of I is present in A ,in that case cardinality is 200.Otherwise it will be less than 200.)
Ex. Min (symb) Max(symb) Min(numb) Max(numb) 3 N2 N2 100 100 4 N1 N1 300 300 5 N1 N1 300 300 6 0 N2 0 100 7 1 N1 1 300 8 N1 N1 300 300 9 0 N3 0 200Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.