Should the user and address be in separate tables?

Currently, my user table has the following fields

Username Password First Name Last Name City Address Country Regional MobNo Email MembershipExpiry NoOfMembers DOB Gender Blocked UserAttempts BlockTime Disabled

I am not sure whether to put the address fields in another table. I heard that I will violate 3NF if I don’t, although I can’t understand why. Can someone explain?

+5
source share
4 answers

There are several points that are definitely not 3NF; and some dubious:

  • Can there be several addresses for each user?
  • ?
  • City, Country, Region ?
  • TelNos?
  • TelNo ?
  • MobNos?
  • MobNo ?
  • ?
  • Email ?
  • NoOfMembers ?
  • UserAttempts?
  • BlockTime ?

, 3NF . 3NF ; , ; - , " //".

, , , - , - , , , , , . ( , , , ?)

EDIT: , , 1-1 . , . , , . , - , , . - .

+8

, , ( 1 1). , ( ), . , , (, ), "--", . EDIT: , - , (-- ), .

+5

, , , FK, .

P.S. , , Id UserId DataId, , ...

0

, , . user_id id, _, _, last_name, , created_at updated_at. .

, .

0

All Articles