database normalization

Results 1 to 3 of 3

Thread: database normalization

  1. #1
    brynnx Guest

    Default database normalization

    is database normalization really a good idea in a web environment? why would joining a bunch of tables be faster when you can use getstring on 1 big table? sure there are redundancies but so what? hard drives are cheap these days!

  2. #2
    Gotta be Trollin... Guest

    Default RE: database normalization

    I hope you're not serious.

  3. #3
    Join Date
    Dec 1969

    Default It's not for space...;s for flexibility and query ability.<BR><BR>Normalized DBs are often larger than unnormalized ones. (Oh, okay, maybe not *often*...but it surely happens enough to not be considered odd at all!)<BR><BR>Suppose you had an ordering system: Customers, InventoryItems, Invoices, InvoiceLineItems, etc.<BR><BR>With a normalized system, separate tables for each of the above, finding all items where you don&#039;t have enough on hand to fulfill the orders is easy:<BR><BR>SELECT II.QuantityOnHand, Sum(ILI.QuantityOrdered), ILI.ItemNumber<BR>FROM InventoryItems AS II, InvoiceLineItems AS ILI<BR>WHERE ILI.ItemNumber = II.ItemNumber<BR>GROUP BY ILI.ItemNumber<BR><BR>Now, try doing that in an unnormalized system, where you chunk all the line items into the invoice. UGH. Ugly at best, unworkable at worst.<BR><BR>Or find all the customers who ordered item # 7731.<BR><BR>Trivial with a normalized DB:<BR><BR>SELECT C.* FROM Customers AS C, Invoices AS INV, InvoiceLineItems AS ILI<BR>WHERE C.CustomerNumber = INV.CustomerNumber<BR>AND INV.InvoiceNumber = ILI.InvoiceNumber<BR>AND ILI.ItemNumber = 7731<BR><BR>Again, just *TRY* doing that in an unnormalized system. <BR><BR>No thanks.<BR><BR>Oh! And now consider the mess you have if you decide to change the price of an item in an unnormalized system! Trivial (one simple single record update) in the normalized one. An ugly multiple field search and replace in the unnormalized DB.<BR><BR>Enough said?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts