-2

Is ther an relation with only one attribute is non-prime (all other attribute are prime), and the relation at 2NF but not at 3NF?

philipxy
  • 14,867
  • 6
  • 39
  • 83
avi n
  • 1
  • What have you done to answer this? Where are you stuck in reasoning or checking out an example? What examples did you find in (2NF &) 3NF? See [ask], other [help] links, hits googling 'stackexchange homework' & the voting arrow mouseover texts. – philipxy Aug 16 '19 at 00:19
  • Hint: Given 2NF with CKs {{K1, K2}, {L1, L2}} & a 5th attribute N, what FD(s) would violate 3NF if they held & why? (How did I find this example? I tried a few simplest cases & I applied the definitions of 2NF & 3NF to them.) – philipxy Aug 17 '19 at 21:26

1 Answers1

-1

If I interpret this right, you are asking this:

"Assuming there is a relation/database table that has only one non-key attribute/column. Is it possible for that table to be in the 2nd NF/normal form, but NOT in the 3rd?"

The answer to that would be no. A relation with one non-key attribute would always be in the 3rd NF as well.

You can think of the conditions 1-3 like this:

  1. To be in the 1st NF, a table's attribute values must not contain enumerations and each table row needs to be unique.
  2. [It's only possible for a table to NOT be in the 2nd NF if it has a composite key.] To be in the 2nd NF, there must not be any non-key attributes that are only dependant on a part of the key. Each of the non-key attributes that are not dependant on the FULL key must be isolated into their own relation, together with the part of the key that they're dependant on. (Of course, the key in the original table is not changed)
  3. [It's only possible for a table to NOT be in the 3rd NF if it has at least two non-key attributes.] To be in the 3rd NF, there must not be any non-key attributes that are only dependant on other non-key attributes. Again, they will need to be isolated into their own relation, for which you usually need to create a key. In the original table, you will have a foreign key left over.

As you can see, to be able to fail the 3rd NF, you need at least two non-key attributes, because one needs to be dependant on the other. If there is less than two non-key attributes and the table is in the 2nd NF already, then it will also be in the 3rd NF.

Legxis
  • 886
  • 7
  • 19
  • You seem to assume all CKs are simple but that's not part of the question. You seem to also be assuming there's only one CK. I say "seem" because also your arguments aren't clear or based on definitions. Also it's a common misconception that all CKs simple implies 2NF--but when also {} is a determinant, there's not 2NF (or 3NF). PS If a question isn't clear then it merits a comment asking for clarification, not an answer. – philipxy Aug 16 '19 at 00:30