php - Relating my normalized tables together -
i have range of tables have normalized user profile section. tables follows;
users --> userprofilesettings --> userpersonalinfo --> usercontactinfo --> useraddresses --> userbusinessinfo --> userbusinesstags --> userbusinesslogo
the users table contains username , password, profile settings containing information whether account active/inactive , date became member. way have in head - user can have 1 entry in each table - , must have entry in each table (apart userbusinesslogo) in order member, table allow multiple rows indentifed user userbusiness tags.
what best way achieve this, 1 many relationships allow multiple rows of same user? have been searching around similar kind of setup cannot seem find examples.
you have over-normalized schema. in general, if have strict one-to-one relationship between tables, should consider merging them single table. if user can have 1 set of personal info, 1 set of contact info, 1 address, , 1 set of business info, put these 1 table don't have worry unintentionally violating these constraints in database.
experience has taught me contact info , addresses end many-to-one relationships person/user records, might reconsider whether (or other tables) one-to-one purposes of app.
Comments
Post a Comment