-1

A relation R(A,B,C,D) is given.

C and D are equivalent (C is the course ID and D is the course name, one implies the other).

C and D are prime attributes.

Does that violate the requirement of 1NF or any other NF?

4
  • 1
    Do both C and D have a (independent) UNIQUE constraint, or is it possible that there exist two courses with the same name (for example, after the department restructured Calculus I, it was given a new ID in the database, but the name was kept)? Apr 28, 2020 at 13:12
  • There is no two courses with the same ID, there is no two courses with the same name. C is unique, D is unique.
    – jkf
    Apr 28, 2020 at 14:22
  • What table a NF is in has nothing to do with any other table.--Quote & apply a definition. But--"1NF" has no single meaning. Nor for that matter "relation". So you need to tell us your definitions & preferably also textbook name & edition. But--This question is not clear. "one implies the other" doesn't make sense. Do you mean each functionally determines the other? "equivalent" doesn't mean anything in particular here, just clearly say what you mean.
    – philipxy
    Oct 13, 2020 at 8:58
  • Right now you are just asking for us to rewrite your textbook with a bespoke tutorial & do your (home)work & you have shown no research or other effort. Please see How to Ask, hits googling 'stackexchange homework' & the voting arrow mouseover texts. Show the steps of your work following your textbook with justification & ask 1 specific researched non-duplicate question re the first place you are stuck. Quote the definitions, theorems, algorithms & heuristics you are relying on. All the steps are also SO faqs.
    – philipxy
    Oct 13, 2020 at 9:02

1 Answer 1

2

As I understand your description C and D are called candidate keys. Either one of them could be used alone as the key. The combination of them both cannot be a candidate keys as each is redundant to the other - given a course ID we know the course name, given a name we know the ID.

Let's say we choose C as the primary key. Then D

  • is atomic so is in 1NF
  • depends on the whole of the key (C) so is in 2NF
  • depends directly on C and not transitively through another attribute so is in 3NF
  • ditto for the higher forms since the chosen primary key is a single column.

Had we chosen D as the primary key then C would be normalized by symmetrical arguments.

2
  • It is wrong to replace "CK" in the definitions by "PK". The definitions say things like, for all CKs, and what is PK irrelevant. Also there's no 1 "1NF" (see my commments on the question). So who knows what either you or the asker mean by it. Also "atomic" "PK" is not what defines any sense of 1NF. And your 3NF conditions are wrong. This is a bunch of wrong fragments not justifying clearly or soundly.
    – philipxy
    Oct 15, 2020 at 13:29
  • Also it doesn't say C & D are CKs, it says they are prime attributes, ie each is a member of some CK. A comment does say each is unique.
    – philipxy
    Oct 15, 2020 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.