1

I am little confused in understanding Candidate Keys. Do we check Candidate Keys in 1st Normal Form tables only?

As we know, a Candidate Key simply consists of a column or group of columns which can take the place of a Primary Key. If there are more than one then any one can stand as a Primary Key.

So, in 1st Normal Form there can be one table also i.e. we can make one big table and fill the whole table with values to remove repeating groups so we make Candidate Keys relating to one big table in 1st Normal Form.

Then what about 2nd Normal Form? or Third Normald Form. Do we find Candidate Keys for tables in these forms or only once, in 1st Normal Form?

If yes, then what does it mean if previous Candidate Keys are not removed which were found in the 1st Normalized Form table before new Candidate Keys are added in 2nd and 3rd Normal Form?

philipxy
  • 14,867
  • 6
  • 39
  • 83
Anonymous
  • 489
  • 1
  • 7
  • 18
  • I have edited your question to improve the language. I'm really not sure what you mean in your 3rd paragraph. Could you edit it to be clear? – philipxy Jun 10 '16 at 06:14
  • I wanted to say that in 1st Normal Form either we can make many relations to remove repeating groups OR we can also go with one table only and just fill all values to remove repeating groups. So, we make Candidate Keys relating to one big table in 1st Normal Form – Anonymous Jun 10 '16 at 06:21
  • To remove a repeating group where the group can have no elements you must add a new relation. Also if every candidate key has a repeating group. See the PS below. – philipxy Jun 10 '16 at 06:25

1 Answers1

2

As we normalize to a higher normal form we replace a relation by other relations that join back to that relation. Each new relation has fewer attributes than the one it came from. And each may satisfy fewer functional dependencies, which are how we determine its candidate keys. Since each relation has its own attributes and satisfied functional dependencies, it may have different candidate keys.

The candidate keys of a relation that we decomposed just don't matter any more because we aren't using it any more. We don't "remove" candidate keys. The candidate keys of a relation depend on its attributes and the functional dependencies it satisfies.

PS Sometimes a non-relational table "normalizes" to multiple 1NF relations. Sometimes "normalizing" a relation to 1NF by replacing attributes by those deemed in some sense "simpler" produces multiple relations.

PPS Normalization does not necessarily involve moving through multiple normal forms.

Community
  • 1
  • 1
philipxy
  • 14,867
  • 6
  • 39
  • 83
  • So it means in simple words that every table whether it is in 1st Normal Form tables or any other Form has its own Candidate Key? I was assuming Candidate key is found once in 1st Normal Form only. – Anonymous Jun 10 '16 at 05:27
  • 1
    Yes, every relation has its own candidate key. I put that in bold in my answer. (See other changes in my message.) – philipxy Jun 10 '16 at 06:00