DataBase Normalization Approches

Results 1 to 2 of 2

Thread: DataBase Normalization Approches

  1. #1
    Join Date
    Dec 1969

    Default DataBase Normalization Approches

    I recently posted one question of finding out no of Subcategories within a particular category.<BR><BR>Now I have right now this database structure.In short<BR><BR>Master Tables<BR>1) m_Category<BR>-Cat_Cd(PK)<BR>-Cat_Name<BR><BR>2) m_SubCategory<BR>-Cat_Cd<BR>-SubCat_Cd<BR>(Above fields Composite PK)<BR>-SubCat_Name<BR><BR>Transaction Table<BR>t_Offers<BR>-Offer_Cd(PK)<BR>-Cat_Cd(FK to m_Category)<BR>-SubCat_Cd(FK to m_SubCategory)<BR>-Offer_Desc<BR><BR>I dont think this is the right way of doing database normalization in this case ??Anyhow It was not done by me !!<BR><BR>Anymore suggestions from experts,SQL masters for better approches are welcome. <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default It looks okay to me...

    In theory, you don&#039;t need the Cat_Cd in the Transaction table (since you can always get it via the SubCat_Cd), but if there were ever cases where you wanted only the category in some report (and not the sub category) then having that extra FK there would improve performance a little.<BR><BR>Assuming these are 4-byte integer id&#039;s, you are only wasting one word per Transaction record. Big deal. Not enough space to worry about unless you get into the millions of transactions. (hundreds of millions?)<BR><BR>Sometimes, a tiny bit of un-normalization is worth having, just for the performance kick you might get. Just be ready to justify it to any pedants who might scrutinize your work (big grin...since I&#039;m such a pedant).<BR><BR>I guess I should note that, if you are allowing the DB to enforce referential integrity, then you need to be sure to tie in both of the relationships to Transaction, but that&#039;s easy enough to do.<BR><BR>Personal opinion: This one is too small (in impact, that is) to worry about, either way.<BR><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