-2

I know that in BCNF if A->B then A must be a candidate key. But what about if A is part of the candidate key but not the whole candidate key?

Let me explain in an example:

Exercise 1:

Candidate keys: {A},{B,C}

Functional dependencies: B->D

Relation: R(B,D)

Is R BCNF as B is part of the candidate key or to be BCNF R should be = (B,C,D)? Also, I guess that if R was = (A,B,D) it is not BCNF and the only way to let R be BCNF should be R = (A,D) or R = (B,C,D) Is that right?

Exercise 2: What would change if now we have the same R as exercise 1 but now we also know that B is primary key?

Candidate keys: {A},{B,C}

Functional dependencies: B->D

Relation: R(B(PK),D) as B is primary key now, if x is primary key it is also candidate key, right? So R in this case is BCNF.

Is everything I said okay?

philipxy
  • 14,867
  • 6
  • 39
  • 83
Lechius
  • 189
  • 7
  • Please ask 1 specific researched non-duplicate question. [ask] [Help] PS "A->B then A must be a candidate key." No. It must be a superkey. Quote & source & use correct definitions from a (good) published reference for the terms you are using. Explain your reasoning as small clearly correct steps leading back to definitions. " if A is part of the candidate key" By definition a CK cannot contain a smaller CK. "PK" PKs have no role in relational theory. A PK is just some 1 CK you decided to call the PK. – philipxy Nov 13 '22 at 18:24
  • 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 be given. [See this answer.](https://stackoverflow.com/a/53386492/3404097) – philipxy Nov 13 '22 at 18:31
  • How can "Relation: R(B,D)" have "Candidate keys: {A},{B,C}"?--A & C aren't attributes of R. (Rhetorical.) "R should be =" This doesn't make sense. You just said R is a certain relation (value? variable/schema?). How it can be equal to something different? Are you trying to say something about one of some components/projections of R to replace R that you could get by decomposing/normalizing R that natural join back to R? Name different things differently. Be clear: Use enough words, sentences & references to parts of examples to clearly & fully say what you mean. – philipxy Nov 13 '22 at 18:42
  • Rather than deleting why not just edit to cut this down to the 1st place you are stuck (but following my earlier comments)? – philipxy Nov 13 '22 at 19:15
  • A CK cannot contain a smaller CK. [Subset of a candidate key](https://stackoverflow.com/q/24980587/3404097) But your BCNF claim is wrong & it's not clear what you mean by "what about" & the rest of your post is not clear & you don't ask just 1 question. – philipxy Nov 16 '22 at 21:23

1 Answers1

1

Look into Second Normal Form. If a relation is not in 2NF, it is therefore not in BCNF. If a deteminant is a subset of a candidate key, and if the determined value is non key, the relation is not in 2NF. And the dermined value cannot be part of the key, becuase a subset of the candidate key would then be a candidate key.

Walter Mitty
  • 18,205
  • 2
  • 28
  • 58