Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COWeeeelll...maybe. Having an addresses table is certainly normalized, but in the real world many times it's overkill, and in fact more often than not even the most hard-core normalization freaks will admit that something like an address -- which in most cases amounts to nothing more than a varchar field -- doesn't need to be normalized into its own table with all the overhead that incurs. Do you really want an SQL join hit for ever users query? Not very performant for such a simple operation. So much depends on the domain, and whether addresses are truly complex and reusable, etc.
      singulars
    2. CO@Dave Sims - I completely, respectfully disagree. In today's world, we need as much information as possible. Normalization (especially with addresses) allows future expansion - we can allow a user to have multiple addresses (home and work for example). And, whether SELECT * returns 10 columns or JOIN returns 10 columns, it doesn't matter (like the overhead is literally insignificant for even incredibly large datasets). Furthermore, you won't ALWAYS show an address with a user, so why would you have it in the users table? It's a separate object
      singulars
    3. CO@Dave Sims - (con't). I look at it this way. I HAVE a first name, I HAVE a last name. I also HAVE an addresses. I DONT HAVE an address_line_1 and address_line_2, zip..., an address HAS an address_line_1, 2..zip, etc. For me, it just makes WAY more sense to have these things separate. Can you have a user without an address? do you REALLY want to restrict access to your site if someone is homeless? I'm being over-the-top, but I think you'll see why normalization is important.
      singulars
 

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