Consider a relation representing the present position of molecules in a closed c
ID: 3662320 • Letter: C
Question
Consider a relation representing the present position of molecules in a closed container. The attributes are the ID for the molecule, the X, Y, and Z coordinates of the molecule, and its velocity in the X, Y, and Z dimensions. Refer to the X, Y, and Z coordinates as PX, PY, and PZ respectively, and the X, Y, and Z velocities as VX, VY, and VZ respectively. a) What functional dependencies do you expect to hold? b) What are the keys? c) Other than the keys list three superkeys. d) Other than the keys how many superkeys are there?
Explanation / Answer
a)
functional dependencies are
ID->PX
ID->PY
ID->PZ
ID->VX
ID->VY
ID->VZ
{PX,PY,PZ} -> VX
{PX,PY,PZ} -> VY
{PX,PY,PZ} -> VZ
B)
1)
since by using ID we can uniquely determine a molicule, hence we can uniquely determine a tuple
2)
since two molicules cannot stay at same position , its position together in x,y,z access can uniquely determine a tuple
hence using PX,PY,PZ can uniquely determine a tuple
1) ID AND 2) PX,PY,PZ both are super keys
since we cannot eliminate any attribute in the above super keys , both are keys
key = ID, {PX,PY,PZ}
C)
adding any attribute to key will become a super key
hence super keys are
1) ID,PX
2) ID,PY
3) ID, PX,PY,PZ
4) PX,PY,PZ, VX
5) ID, PX,PY,PZ,VY
d)
let S(ID) = number of superkeys that contain key = ID
S(PX,PY,PZ) = number of keys that contain key = PX,PY,PZ
S(ID, PX,PY,PZ) = number of keys that contain both keys key = ID and PX,PY,PZ
adding zero or more attributes to ID will become a super key
S(ID) = number of subsets {PX,PY,PZ,VX,VY,VZ} = 2^6 = 64
adding zero or more attributes to {PX,PY,PZ} will become a superkey
S(PX,PY,PZ) = number of subsets {ID,VX,VY,VZ} = 2^4 = 16
adding zero or more attributes to {ID,PX,PY,PZ} will become a super key
S(ID, PX,PY,PZ) = number of subsets {VX,VY,VZ} = 2^3 = 8
total number of superkeys = S(ID) + S(PX,PY,PZ) - S(ID,PX,PY,PZ) = 64 + 16 - 8 = 72
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.