0

I'm sorry for the basic question but I'm struggling a bit with 3NF. This is the table I'm talking about:

User (Nickname, Email, Password, Name, Surname, DocumentId, Telephone, Avatar, Biography)

I think this table is not normalized in the third normal form because there are several functional dependencies due to the two candidate keys (DocumentId and Telephone):

  • DocumentId -> Nickname, Email, Password, Name, Surname, Telephone, Avatar, Biography
  • Telephone -> Nickname, Email, Password, Name, Surname, DocumentId, Avatar, Biography

Am I wrong? I am not so sure about the correctness of these functional dependencies. Are they correct? Also, how can I normalize this table?

Edit:

To specify, 2 users can't have the same DocumentId, the same Email and the same telephone number.

So this should be another functional dependency:

  • Email -> Nickname, Password, Name, Surname, DocumentId, Avatar, Biography, Telephone
user16036629
  • 15
  • 1
  • 5
  • 1
    Did you look up a definition for 3NF? Did you search SO for the topic? There are heaps of answers. Did you see mention in the definition for 3NF of 'transitive dependencies'? Did you search SO for that? Again there are heaps of answers. – AntC Jun 13 '21 at 22:13
  • What is your 1 specific researched non-duplicate question? If you think certain FDs hold or don't hold, why? – philipxy Jun 14 '21 at 01:36
  • Re "is this right": Ask 1 specific question re where you are 1st stuck/unsure. Show the givens & steps of your work following your reference, with justification--not all terms/notations are standard & we don't know exactly what algorithm/method you are following & we want to check your work but not redo it & we need your choices when an algorithm allows them & otherwise we can't tell you where you went right or wrong & we don't want to rewrite your reference. Please see [ask], [help], hits googling 'stackexchange homework' & the voting arrow mouseover texts. Basic questions are SO faqs. – philipxy Jun 14 '21 at 01:38
  • @AntC, yes, I actually did. I have said that I'm struggling with this. If I hadn't done my researches and studies I wouldn't have said that. Also, I see no point in asking a question without a prior knowledge about the argument. Usually, asking here is my last resort, actually. – user16036629 Jun 14 '21 at 04:00
  • @philipxy should I create the post again or should I add the needed information to this project? – user16036629 Jun 14 '21 at 04:04
  • Click on 'edit' to edit a post. See the links I gave & you can google using 'site:meta.stackoverflow.com' or 'site:meta.stackexchange.com' for Q&A re how to use the site. Clarify via edits not comments. Just include what is needed to ask your 1 question. Be very clear about exactly what is given & what you are trying to accomplish with/about it & what definitions & process you are following from where in what reference & where you are 1st stuck. – philipxy Jun 14 '21 at 04:12
  • Thank you for your answer. I'll try to be more specific! – user16036629 Jun 14 '21 at 04:14
  • There are question posts & answer posts & each can have comments. Please read the help pages & FAQ pages. See [How do comment replies work?](https://meta.stackexchange.com/q/43019/266284) to learn to use `@x` to notify one non-sole non-poster commenter `x` re a comment. Posters, sole commenters & followers of posts always get notified. – philipxy Jun 14 '21 at 04:16

1 Answers1

0

https://en.wikipedia.org/wiki/Third_normal_form "A database relation (e.g. a database table) is said to meet third normal form standards if all the attributes (e.g. database columns) are functionally dependent on solely the primary key. Codd defined this as a relation in second normal form where all non-prime attributes depend only on the candidate keys and do not have a transitive dependency on another key."

From a list of attributes, no-one could possibly know whether your data is in some normal form. Where have you got this question? Is that all it tells you?

You don't tell us enough about the properties of your data, but I'm guessing from the attribute names that there are 'transitive dependencies'.

All of the attributes other than DocumentId look like they relate to a person, so (for example) Email would identify a person, and be as much a candidate key as Telephone. Or might there be people with distinct Telephone but sharing one Email?

Whereas I'd expect there to be multiple documents/DocumentIds for each person. Or is this a DocumentId for some specific document (such as their biography -- but in that case what is attribute Biography?)

BTW ref that quote from Codd: there doesn't have to be one key that's 'primary'. For 3NF there can be multiple keys, providing for each every other attribute is dependent. (Note also keys might be compound/not a single attribute.)

AntC
  • 2,623
  • 1
  • 13
  • 20
  • Basically, a person can have only a unique telephone number, a unique DocumentId and unique email (I didn't thought about Email as a candidate key). Biography is nothing but just a brief description about the user and it doesn't need to be unique. Same reasoning goes for the avatar. – user16036629 Jun 14 '21 at 04:09
  • Did you read the definitions you quote? I would expect that you know that they are wrong beyond mentioning PKs rather than CKs. – philipxy Jun 14 '21 at 06:19
  • @philipxy what definitions are you talking about, specifically? – user16036629 Jun 14 '21 at 17:21
  • @user16036629 Each of the 2 sentences in the quote. (I don't see how this is not evident.) PS The 2 definitions in the definition section of the article are correct except that the definition of transitive FD is wrong & one's definition of 2NF depends on one's definition of 1NF but ["1NF" has no fixed meaning.](https://stackoverflow.com/a/40640962/3404097) All involve possibly replacing some table with parameterized structure by some table(s) with a column per parameter. – philipxy Jun 14 '21 at 19:19