Does unique email in user table violate normal forms?

All we need is an easy explanation of the problem, so here it is.

USER(userID, email, name, address, …)

userID

  • primary key
  • incrementing bigint

email

  • unique identifier
  • can be modified by user

To me this seemed like a good idea, but then I started to wonder: does the uniqueness of ’email’ violate the third normal form (3NF)?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

To extend the hole idea why index doesn’t matter

A indexed filed onlys describes that every row is unique, but this doewsn’z means that it is dependend from other columns than the promary key

A relation is in third normal form if there is no transitive dependency for non-prime attributes

following this definition, it still stands an indexed email field is dependent on the primary key and does not depend on other columns it is non transitively dependent

Which means that it correspnds teh 3NF

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply