Assume that attributes with the same name in different relations represent the s
ID: 3750962 • Letter: A
Question
Assume that attributes with the same name in different relations represent the same domain and that the primary key attributes in each relation are underlined. Answer the following questions given the relational schema below:
List all potential foreign keys in the three relations. (1 mark)
List all superkeys of S. (1 mark)
List all candidate keys of T. (1 mark)
What is the degree and cardinality of S? (1 mark)
If the cardinality of T is N, what is the cardinality of D,H(T)? (1 mark)
Please give breif explanations, thank you.
Explanation / Answer
List all potential foreign keys in the three relations. (1 mark)
R(C,D)
S(D)
are the potential foriegn keys because a primary in a table act like a foreign key in another table. In our case C is PK in S so it is FK in R, D is PK in T so it is FK in R and S.
List all superkeys of S. (1 mark)
B and C both combination is the superkey. B and C both will be unique.
List all candidate keys of T. (1 mark)
D is the candidate key, because it is the minimal superkey and also the primary key.
What is the degree and cardinality of S? (1 mark)
Degree is 4 because S has 4 fields. Cardinality is 3 because it involves in three tables.
If the cardinality of T is N, what is the cardinality of D,H(T)? (1 mark)
is called projection which is used to capture columns. And here it is 2 because 2 columns are selected.