Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>By splitting the user in this way you have exactly 1 row in user per user, which links to 0-n rows each in user_tel, user_details, user_addr</p> <p>This in turn means that these can be considered optional, and/or each user may have more than one telephone number linked to them. All in all it's a more adaptable solution than hardcoding it so that users always have up to 1 address, up to 1 telephone number.</p> <p>The alternative method is to have i.e. <code>user.telephone1</code> <code>user.telephone2</code> etc., however this methodology goes against 3NF ( <a href="http://en.wikipedia.org/wiki/Third_normal_form" rel="nofollow">http://en.wikipedia.org/wiki/Third_normal_form</a> ) - essentially you are introducing a lot of columns to store the same piece of information</p> <p><strong>edit</strong> </p> <p>Based on the additional edit from OP, assuming that each user will have precisely 0 or 1 of each tel, address, details, and <strong>NEVER</strong> any more, then storing those pieces of information in separate tables is overkill. It would be more sensible to store within a single user table with columns user_id, username, tel_no, addr, details.</p> <p>If memory serves this is perfectly fine within 3NF though. You stated this is not about normal form, however if each piece of data is considered directly related to that specific user then it is fine to have it within the table.</p> <p>If you later expanded the table to have telephone1, telephone2 (for example) then that would violate 1NF. If you have duplicate fields (i.e. multiple users share an address, which is entirely plausible), then that violates 2NF which in turn violates 3NF</p> <p>This point about violating 2NF may well be why someone has done this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload