0

Customer table having attributes (id, name, email, password, mobile). There are two candidate keys one is id, and the other is email, but the primary key is only id. customer_table

  • Why would or wouldn't it be? What does that CK situation have to do with 2NF? What are the definitions of those terms & where do you get stuck applying them? [ask] [Help] PS Are you asking about that table value, or about a variable that can hold that value? PS Please [use text, not images/links, for text--including tables & ERDs](https://meta.stackoverflow.com/q/285551/3404097). Paraphrase or quote from other text. Give just what you need & relate it to your problem. Use images only for what cannot be expressed as text or to augment text. Include a legend/key & explanation with an image. – philipxy Jul 27 '21 at 19:31
  • This is a faq. Please before considering posting read the manual & google any error message & many clear, concise & precise phrasings of your question/problem/goal, with & without your particular names/strings/numbers, 'site:stackoverflow.com' & tags; read many answers. Reflect your research. PS [How do I ask and answer homework questions?](https://meta.stackoverflow.com/q/334822/3404097) [What is the policy here on homework?](https://meta.stackexchange.com/q/18242/266284) – philipxy Jul 27 '21 at 19:35
  • Does this answer your question? [Normal forms - 2nd vs 3rd - is the difference just composite keys? non trivial dependency?](https://stackoverflow.com/questions/27474203/normal-forms-2nd-vs-3rd-is-the-difference-just-composite-keys-non-trivial-d) – philipxy Jul 27 '21 at 19:35
  • Does this answer your question? [when a 1NF table has no composite candidate keys is it in 2NF?](https://stackoverflow.com/q/10936387/3404097) It is a common misconception that all CKs simple implies 2NF. PS You say there are 2 simple CKs, but you do not say what other CKs or FDs there are or aren't. So if you're trying to ask that question, you aren't. PS CKs & FKs matter to DB normalization to higher NFs. PKs do not. One CK can be called PK. That has nothing to do with normalization. – philipxy Jul 27 '21 at 23:51

1 Answers1

-1

It is in Second Normal Form. However, SNF only applies to table with composite primary keys (if you try to mix 2 or more entities into 1 table). Which does not even apply to your table here.

Both email and mobile can be candidate key. If you go by the logic that phone number is unique for a person.

Do we have any functional dependency between name and email or name and mobile? password and email? password and mobile? If this person get a new phone number does he need to change his name? I don't think so. If you are concern about the id, if this person get a new email do we need to update this artificially generated id in the table? no. If the id was 13 and we don't like this number and changed to 14 do we need to change the person's name or password for him? Also no

SNF definition: cannot have a non-prime attribute that depends on part of any candidate key (no partial dependency) And we just proved there isn't any

BabyishTank
  • 865
  • 1
  • 9
  • 29