Solved

Intersection Tables

Posted on 2004-09-24
4
1,580 Views
Last Modified: 2012-08-14
During the normalization process, when do you know there's a need for an intersection table?  At which stage (i.e., first, second, third normal form) does it become apparent there's a need for one?  What is the key sign that signals there's a need for one?
0
Comment
Question by:lcor
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 500 total points
ID: 12143457
Whenever you identify a many-to-many relationship between entities, it has to be resolved by putting an intersection/associate table between them.
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12143502
Many intersection table only have two columns, the primary key of each of the two tables. Of course, if the primary key of a table is comprised of more than one column, the intersection table has to have all the columns of the primary keys.

It can have additional columns as attributes, if the attribute is an attribute of the relationship, not of the entities the intersection table is related to.
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12143554
So, if your business logic dictates that one doctor can have many patients, and each patient can have many doctors, you could implement something like this:

Doctor(DoctorID, Title, FirstName, LastName,...)
[DoctorID is the primary key]

Patient(PatientID, FirstName, LastName,...)
[PatientID is the primary key]

DoctorPatient(DoctorID, PatientID, DateRelationshipBegan)
[Primary key is DoctorID and PatientID; DoctorID is a foreign key to Doctor; PatientID is a foreign key to Patient; and DateRelationshipBegan is a attribute of the relationship between doctors and patients.]
0
 

Author Comment

by:lcor
ID: 12145199
Answers my question perfectly!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now