Find minimal candidate keys - database

I have 2 sets
R = {A B C D}
H = {AB-> C , AB-> D, D-> B}
Want to find all minimal keys in R set
My answer for minimal keys is : { A D }
this is because
AB -> C and AB -> D then AB -> CD
since D -> B then AD is the minimal keys
when i check my answer with this site. the site giving wrong answer.
can explain?

The site says, "Set of found candidate-keys: {{A, C, F}, {B, C, F}}." That's clearly wrong; F isn't even in R.
In any case, your answer is incomplete. AD is one of two candidate keys.

Related

Relation Schema : How to solve this

I can't solve it.please help
Q In a relation schema R = (A, B, C, D, E), the following functional dependencies are held:
A → BC
CD → E
B → D
E → A
Which of the following is a combination of two candidate keys for R?
Answer Choice:
a) A and E
b) B and C
c) B and D
d) C and D
The Correct Answer is a) A and E
But if E depend on A ( E → A), then why option a) A and E is correct? please help
We can compute the closure of the functional dependencies for each set of attributes on the left-hand side of an FD:
A -> A (Trivial)
A -> ABC (since A -> BC)
A -> ABCD (since B -> D)
A -> ABCDE (since CD -> E)
So we can see that A determines all attributes in the relation. A is a candidate key. For CD, we get:
CD -> CD (trivial)
CD -> CDE (since CD -> E)
CD -> CDEA (since E -> A)
CD -> CDEAB (since A -> BC)
So CD is a candidate key. For B, the most we can derive is:
B -> B (trivial)
B -> BD (since B -> D)
For E:
E -> E (trivial)
E -> EA (since E -> A)
E -> EABC (since A -> BC)
E -> EABCD (since B -> D)
Again, we can determine all attributes in R so E is a candidate key.
So we've got candidate keys A, E and CD. Now, read the question carefully. Which of the possible answers are a combination of two candidate keys? Option d has two attributes of a single candidate key. Options b and c contain B which isn't a candidate key. The only correct answer is a) A and E, which lists two separate candidate keys.

Need to find a minimal basis

I'm struggling with finding a minimal basis for the given relation and FD's. Can you please confirm I'm doing it right?
I've got R(A, B, C, D, E, F, G)
A -> G
E -> F,G
C,D -> B
B -> E
C,D -> A
After checking each FD there is nothing to remove, so my minimal basis is
A -> G
E -> F
E -> G
C,D -> B
B -> E
C,D -> A
and the key is (C,D) as (C,D)+ = (C,D,A,B,E,F,G)
Many thanks
In American English, I think the term is minimal cover.
CD is the only candidate key in R.
I'm not sure what you mean by "checking each FD", but your result is right.

functional dependencies candidate keys

Consider the following relation and the set of functional dependencies (FDs).
R = (A B C D E F G H I)
D -> H
DH -> A
EFH -> C
AF -> IG
CD -> ABG
IB -> C
G -> I
IBC->E
F -> H
C -> IE
Find the candidate key(s) of R.
Find the minimal cover of FD set.
I think "DF" is one of candicate keys.
The ONLY candidate key is DF.
And the Minimal cover is as follows:
D->AH;
EF->C;
AF->G;
CD->ABG;
IB->C;
G->I;
F->H;
C->IE

Getting BCNF from a group of functional dependencies

Here is a group of FDs(3NF):
A-> BDEFG
CF->A
BG->C
How can I decompose this relation to BCNF?
I guess there are still dependencies in CF->A because A->F, but have no idea how to decompose it..
Anyone can help please?
Thanks!
For FD 1 and FD 2, you can see that A and CF are both keys of this relation and these FDs do not violate BCNF. For FD 3, BG is not the key so you need to decompose into : {B G C} AND { B G A D E F} according to the decomposing algorithm. Now it's done since {B G C} corresponds to FD 3 and { B G A D E F} satisfies with FD 1. Hope this helps.

Is this functional dependancy a trivial? (Relational Database Design)

I have this problem:
R = (A, B, C, D, E)
and
F = (A -> BC, B -> CD, E -> AD)
the book says that this in BCNF because all FDs are trivial.
My question is: how this FDs is trivial?
by what you've posted :
R = ABCDE
A -> BC
B -> CD
E -> AD
the candidate key is E
All the left hand side FDs do not show E so this is not a BCNF.
and hence the non trivial FD.

Resources