retagged by
885 views
1 votes
1 votes

User

 

Consider a relation R(ABCDEFGH). How many superkey will be there in relation Rif candidate key for relation are {A, BC, CDE, EF}?

retagged by

1 Answer

1 votes
1 votes

We will use the inclusion-exclusion principle. Brilliant, AoPS.

$A\cup BC\cup CDE\cup EF = A+ BC +CDE+ EF -(A\cap(BC))-(A\cap(CDE)) -(A\cap(EF))-((BC)\cap(CDE))-((BC)\cap(EF))-((CDE)\cap(EF))$
$+(A\cap(BC)\cap (CDE))+((BC)\cap(CDE)\cap (EF))+((A)\cap(CDE)\cap (EF))+((A)\cap(BC)\cap (EF))$
$-(A\cap (BC)\cap (CDE)\cap (EF))$

here $A=2^7$, no. of superkeys have A attribute

$BC=2^6$, no. of superkeys have BC attributes

$CDE=2^5$, no. of superkeys have CDE attributes

$EF=2^6$, no. of superkeys have EFattributes

$A\cap BC=2^5$, no. of superkeys have ABC attributes

$BC\cap CDE=2^4$, no. of superkeys have BC attributes

$A\cap CDE = 2^4$, no. of superkeys have ACDE attributes

$A\cap EF = 2^5$, no. of superkeys have AEF attributes

$BC\cap EF=2^4$, no. of superkeys have BCEFattributes

$CDE \cap EF=2^4$, no. of superkeys have CDEF attributes

$A\cap(BC)\cap (CDE)=2^3$, no. of superkeys have ABCDE attributes

$BC\cap CDE \cap EF=2^3$, no. of superkeys have BCDE attributes

$A\cap BC\cap EF=2^3$, no. of superkeys have ABCEF attributes

$A\cap (BC)\cap (CDE)\cap EF=2^2$, no. of superkeys have ABCDEF attributes

Chip in the values in the equation and we will get no. of superkeys =188

 

Related questions

2 votes
2 votes
1 answer
1
srestha asked May 9, 2019
1,876 views
Consider the relation $R\left ( A,B,C,D,E \right )$$A\rightarrow BC$$C\rightarrow E$$B\rightarrow D$$E\rightarrow A$Total number of superkeys present in relation will be ...
0 votes
0 votes
0 answers
3
aashijn asked Apr 28, 2022
1,430 views
employee (person-name, street, city)works (person-name, company-name, salary)company (company-name, city)manages (person-name, manager-name) a. Find the names of all empl...
0 votes
0 votes
1 answer
4
ssm asked Apr 18
147 views
R(A1, A2,A3,A4....AN). How many super keys possible in relation? If (A1 is candidate key, A2 is candidate key, A3 is candidate key)