Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Intersection Tables

Posted on 2004-09-24
4
Medium Priority
?
1,689 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 2000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

610 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