Home > Oracle Database / Applications Tips > > What you don't know about denormalization can hurt you, Part II
Oracle Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


What you don't know about denormalization can hurt you, Part II


fabian pascal
05.07.2001
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


In Part I, I argued that the least and the best a DBMS can do to ensure database correctness it to enforce the integrity constraints representing the business rules in effect in the real world--and that it is relational theory that guarantees such correctness. While few practitioners deny that databases and query results must be logically correct, many dismiss relational principles such as normalization as "just theory" and, therefore, not practical. This is, of course, an inconsistent position in itself. What is more, consider on what some such dismissals are frequently based, as demonstrated by the following exchange:

I love the sneering critiques written by those crazed Relational Theorists at Database Debunkings.They are worth reading.

I don't. Although some of the quotes are truly hysterical--and thus justify my hourly rate whenever questioned--I don't feel comfortable with the implication that I am somehow a lesser entity because I don't understand all the mathematics involved in relational theory. I'm sure therapy and some remedial set theory would help.

I don't know if therapy would help--probably not--but nothing on our site implies that practitioners without a mastering of the mathematics of relations are "lesser entities." What it does demonstrate is that those who flout relational principles such as normalization in their work are lesser database practitioners. While some familiarity with logic and mathematics would not hurt, it's DBMS designers who must master the theory if they are to construct DBMSs that guarantee correctness--and judging by current products, it does not look as if they do, because practitioners don't demand it.

Let me now demonstrate the practical importance of normalized databases for correctness--and put your grasp of critical database fundamentals to test--with an example and a challenge. In Figure 1, table A and tables B1 and B2 are two representations of assignments of employees to projects and to project activities. Assume the following business rules are in effect in the real world:

  • an employee can be assigned to any specified project and to all of the specified activities
  • an employee can be assigned to any number of projects and any number of activities
  • projects and activities are independent of each other: no matter what project an employee is assigned to, the activity assignments are the same
  • a given project or activity can have any number of employees assigned to it

This means that the relationships between employees, projects, and activities are each many-to-many (M:M) and that assignments to projects and to activities are independent.


Figure 1: Less than 4NF (A) and fully normalized (B1, B2) representations

Tables B1 and B2 are the correct, fully normalized (5NF) representation. Fully normalized designs have no redundancy due to column (a) dependencies on non-key columns (b) indirect dependencies on key columns (c) dependencies on parts of composite key columns (why?) and, in the absence of other types of redundancy, DBMS enforcement of key constraints is sufficient to ensure correctness. In other words, given a relational DBMS, with B1 and B2 you would declare keys at table definition time and would be done.

Denormalization proponents, however, would prefer one table, A, which is in 3NF, but not in 4NF. Being undernormalized, table A suffers from (highlighted) redundancy (why?) and requires an integrity constraint in addition to the (composite) key constraint to ensure correctness (why?).

The challenge is to specify the additional constraint and express it in SQL.

About the Author

Fabian Pascal has a national and international reputation as an independent database technology analyst, industry critic, consultant, author and lecturer. For more than 13 years he held various analytical, and management positions in the private and public sectors, was affiliated with Codd & Date, has taught and lectured at the business and academic levels, and advised vendor and user organizations on database technology and implementation. He is co-founder and editor of Database Debunkings, a web site dedicated to dispelling prevailing fallacies and misconceptions in the database industry, with C.J. Date as senior contributor. He has contributed extensively to most trade publications, and his third book, Practical Issues in Database Management--A Guide for the Thinking Practitioner, was recently published by Addison Wesley.

For More Information


Rate this Tip
To rate tips, you must be a member of SearchOracle.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Oracle Development Solutions - SQL, J2EE, XML, SOA
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts