Types of Table Relationships

| No Comments | No TrackBacks

To create a good database, I have to know the relationship between tables.
It is clear, the database I talking about is relationship database.

There are three types of table relationships.


  • One-to-one relationships

  • One-to-many relationships

  • Many-to-many relationships

One-to-one relationships
In a one-to-one relationship, a key will appear only once in a related table. It is the most simply relation.

One-to-many relationships
In a one-to-many relationship, keys from one table will appear multiple times in a related table.
The exapmle is a connection between department and employees. One department has many employees. One employee can only be in one department.
It is a very common type of relationship.

Many-to-many relationships
The many-to-many relationship often causes problems in practical examples of normalized databases, so much so that it is common to simply break many-to-many relationships into a series of one-to-many relationships.
I call it an intermediate table, which is one-to-many table. It connect the many-to-many tables.


Related Articles

No TrackBacks

TrackBack URL: http://www.yinfor.com/mtcgi/mt-t-1010.cgi/2126

Leave a comment

About this Entry

This page contains a single entry by David Yin published on April 14, 2008 10:19 PM.

Know more about Windows Registry was the previous entry in this blog.

phpMyAdmin can help to access MySQL is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.21-en

Online Tools