Home arrow MySQL arrow Page 5 - Database Normalization And Design Techniques
MYSQL

Database Normalization And Design Techniques


What is database normalization and how does it apply to us? In this article Barry teaches us the best way to structure our database for typical situations.

Author Info:
By: Barry Wise
Rating: 5 stars5 stars5 stars5 stars5 stars / 57
January 09, 2003
TABLE OF CONTENTS:
  1. · Database Normalization And Design Techniques
  2. · Zero Form
  3. · Second Form
  4. · Data Relationships
  5. · Fourth Normal Form
  6. · Conclusion

print this article
SEARCH DEVARTICLES

Database Normalization And Design Techniques - Fourth Normal Form
(Page 5 of 6 )

  1. In a many-to-many relationship, independent entities can not be stored in the same table.

Since it only applies to the many-to-many relationship, most developers can rightfully ignore this rule. But it does come in handy in certain situations, such as this one.

We've successfully streamlined our urls table to remove duplicate entries and moved the relationships into their own table.
Just to give you a practical example, now we can select all of Joe's urls by performing the following SQL call:

SELECT name, url FROM users, urls, url_relations WHERE url_relations.relatedUserId = 1 AND users.userId = 1 AND urls.urlId = url_relations.relatedUrlId

And if we wanted to loop through everybody's User and Url information, we'd do something like this:

SELECT name, url FROM users, urls, url_relations WHERE users.userId = url_relations.relatedUserId AND urls.urlId = url_relations.relatedUrlId

Fifth Normal Form

There is one more form of normalization which is sometimes applied, but it is indeed very esoteric and is in most cases probably not required to get the most functionality out of your data structure or application.

Its tenet suggests:
  1. The original table must be reconstructed from the tables into which it has been broken down.

The benefit of applying this rule ensures you have not created any extraneous columns in your tables, and that all of the table structures you have created are only as large as they need to be.

It's good practice to apply this rule, but unless you're dealing with a very large data schema you probably won't need it.
blog comments powered by Disqus
MYSQL ARTICLES

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials