{"id":82102,"date":"2011-03-21T20:48:17","date_gmt":"2011-03-21T20:48:17","guid":{"rendered":"https:\/\/www.webstaging.red-gate.com\/simple-talk\/?p=73362"},"modified":"2018-12-12T12:11:58","modified_gmt":"2018-12-12T12:11:58","slug":"chapter-5-normalization","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/chapter-5-normalization\/","title":{"rendered":"Chapter 5\u2013Normalization"},"content":{"rendered":"<p>I won\u2019t try to kid you. I love this subject. When you finally see the power and simplicity of it all, it is like a 200 watt halogen light bulb going off over your head in a cavern where you previously only had one of those little led lights on a key chain. In fact, it is the simplicity of normalization that makes it so much fun.&#160; Of course, knowledge of normalization isn\u2019t the only thing that makes you a good database designer and realistically, most people do some level of normalization without even knowing it. I dare you to find a database that has only one table with one column that expresses more than one concept. Even a newbie with an excel workbook will start to add worksheets as it becomes more difficult to manage their data in that workbook. However, understanding why you do that natural process is half of the battle.<\/p>\n<p>The approach I will take in this chapter is to break down things into 4 major sections:<\/p>\n<ul>\n<li><strong>Entity and Attribute Shape<\/strong> \u2013 Basically this encompasses the definition of what makes a table a table and not a different data structure, and First Normal Form       <\/li>\n<li><strong>Attribute Interdependency<\/strong> \u2013 Essentially the Boyce Codd Normal Form, which is basically ensuring tables have all keys defined and all non-key attributes reference the entire key set of all keys.&#160; This encompasses Second and Third Normal Form). I had a person comment to me that the Second and Third Normal Forms were confusing, and after some reflection, I think it has to do with the way we implement databases today. Second has to do with non-key attributes referencing other non-key attributes, and Third is about non-key attributes referencing primary key attributes. But the trend is to have a surrogate primary key, so it just doesn\u2019t click. In Boyce Code, it is about any key, rather than specifically the primary key. And a surrogate key isn\u2019t really a key in and of itself, but a generated value that stands in for the key for ease of use and performance reasons.       <\/li>\n<li><strong>Multivalued Dependencies<\/strong> \u2013 This references Fourth and Fifth Normal forms in a practical manner that isn\u2019t confusing to the average programmer.       <\/li>\n<li><strong>Denormalization<\/strong> \u2013 Selectively choosing to not implement a rule of normalization to achieve some purpose, often for a (hopefully real) performance issue. This is not to be confused with unnormalized, which is just going with what you have because it works on your machine for the size of data and the questions you are asking of it. Also known as normalcy. <\/li>\n<\/ul>\n<p>One of my desires in each edition of the book is to tackle the higher normal forms in more and better manners that a person like me can understand. I am pretty thick at times, and a lot of concepts just go beyond me in their mathematical notation laden versions. Not that I am against that sort of thing, it is just that I don\u2019t really get it until I get a simplistic example to follow.&#160; And even worse, too many writers gloss over the details of complex topics by simply puking up the wording from the original writer and moving along, not even giving examples. I feel that if you are going to bring up a topic, you cover it, give examples, and explain it. It isn\u2019t always practical and often I wish I didn\u2019t feel that way (and I wish my editors didn\u2019t feel that way too.)<\/p>\n<p>In this edition, I am going to be changing up a bit of my material on First and Fourth, and Fifth Normal forms (moving some of the non-key multi-valued dependencies stuff to first normal form, since really what I describe there is technically first normal form\u2019s requirement to have single valued attributes, though I have seen it described in multiple places as fourth\u2026Again, kind of confusing).&#160; <\/p>\n<p>Along the way, I have been doing some research to see if I can find a better way to describe the Fourth and Fifth normal form. I wanted to list a lot of great sites about normalization, but I can\u2019t really find anything out there other than William Kent\u2019s paper here: <a title=\"http:\/\/www.bkent.net\/Doc\/simple5.htm\" href=\"http:\/\/www.bkent.net\/Doc\/simple5.htm\">http:\/\/www.bkent.net\/Doc\/simple5.htm<\/a>. It was written back in 1982 (September to be exact), but it was the best overall thing I could find. Most other sites were too terse to glean more than an idea from, not enough to put out there for reading. <\/p>\n<p>&#160;<\/p>\n<p>After I finish chapter 5, it will be time to make some major structure choices about the book, and decide if I want to dig into the new pattern\/modeling chapters, or finish the rehash. The rehash is kind of mundane, though a decent amount of it will require touch-ups to cover the new Denali changes to\u2026 well, not sure what is or isn\u2019t NDA, but suffice it to say\u2026 there may or may not be changes!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I won\u2019t try to kid you. I love this subject. When you finally see the power and simplicity of it all, it is like a 200 watt halogen light bulb going off over your head in a cavern where you previously only had one of those little led lights on a key chain. In fact,&#8230;&hellip;<\/p>\n","protected":false},"author":56085,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[19684],"class_list":["post-82102","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/82102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/56085"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=82102"}],"version-history":[{"count":1,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/82102\/revisions"}],"predecessor-version":[{"id":82278,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/82102\/revisions\/82278"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=82102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=82102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=82102"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=82102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}