0

I have R(A, B, C, D, E, F) with following functional dependencies:

{AB}->{D}
{D}->{C}
{AC}->{E}
{E}->{B}
{BC}->{F}

The relation has 4 candidate keys AB, AC, AD and AE.

According to Wikipedia:

A relation is in the second normal form if it fulfils the following two requirements:

  1. It is in first normal form.
  2. It does not have any non-prime attribute that is functionally dependent on any proper subset of any candidate key of the relation.

Thus the above relations should be in 2nd Normal Form, as F is the only non-prime attribute of the relation and it is not dependent on any proper subset of any candidate key.

But one of the answers https://stackoverflow.com/a/10114098/13861908, on stack overflow, says that

A table is in 2NF if and only if, it is in 1NF and every non-prime attribute of the table is either dependent on the whole of a candidate key, or on another non-prime attribute.

According to this definition, the relation is not in 2nd Normal Form, as {BC} is neither a super key nor contain any non-prime attribute.

Clearly, I am missing out something. Please help.

philipxy
  • 14,867
  • 6
  • 39
  • 83
  • Your "I have these FDs" doesn't make sense. "These are all the FDs that hold"?--Not possible. "These are all the non-trivial FDs that hold"?--Not possible. "These are some FDs that hold"?--Question can't be answered. Find out what a *cover* is & what the exact conditions are to apply a particular definition/rule/algorithm. To determine CKs & NFs we must be given FDs that form a cover. Sometimes a minimal/irreducible cover. And the set of all attributes must given. [See this answer.](https://stackoverflow.com/a/53386492/3404097) – philipxy Jul 06 '20 at 03:28
  • ["1NF" has no single meaning.](https://stackoverflow.com/a/40640962/3404097) Nor does for that matter "relation". So you need to tell us your definitions & preferably also textbook name & edition. PS You don't show that F "is not dependent on any proper subset of any candidate key". PS Follow a published academic textbook on information modelling, the relational model & DB design & querying. (Manuals for languages & tools to record & use designs are not such textbooks.) (Nor are wiki articles or web posts.) Dozens are online free in pdf & html. – philipxy Jul 06 '20 at 03:29
  • Please show the steps of your work so we can say where you went wrong. PS That SO definition is wrong. Seems the writer doesn't know how to negate statements or write clearly & doesn't know CKs can be compound. They want to rephrase "no FD determining a non-prime attribute is ..." to "every FD determining a non-prime attribute is ...", but they made a mess of it. But that's not in Wikipedia now--did you look? It was there for about a year. Anyway what do you expect from Wikipedia vs a published edited reviewed professor-written professor-used textbook? (Although the latter can still be poor.) – philipxy Jul 06 '20 at 04:46
  • The first definition is correct and the schema is in 2nf. – Renzo Jul 06 '20 at 11:41
  • @Renzo If those FDs form a cover, yes, but the asker doesn't say nor why they think F is not partially dependent on a CK, so who knows whether they understand. (Not suggesting you disagree.) – philipxy Jul 07 '20 at 00:05
  • @philipxy Yes, the given FDs form a cover and {A, B, C, D, E, F} is the complete set of attributes of the relation. F is not functionally dependent on any proper subset of any of the CKs {CKs: AB, AC, AD, AE} that's why I think that F is not partially dependent on a CK. Thanks for the explanation. – SRIJAN KUMAR JAISWAL Jul 09 '20 at 17:56
  • Please clarify via edits, not comments. I said earlier, say why you think F is not partially functionally dependent on any proper subset of the CKs, ie those sets, in detail, referencing givens, definitions, theorems, algorithms & basic logical reasoning. We can't say whether your reasoning is correct unless you give all steps of it. If you're only looking at the FDs in that list, your reasoning is wrong. – philipxy Jul 09 '20 at 18:26

0 Answers0