Solved

Intersection Tables

Posted on 2004-09-24
4
1,624 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

821 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