Relationships

In Microsoft® Access®, data can be stored in one database file where the file can contain multiple tables with defined relationships between the tables.

In the ongoing example the following table was used to store teacher information:

Teacher_ID First_Name Last_Name School Email
1 Jane Doe A Elementary jdoe@district.k12.ky.us
2 John Doe C High jdoe2@district.k12.ky.us
3 Joe Teacher B Middle jteacher@district.k12.ky.us

Of particular note is the School field in this table.  Each school will certainly have more than one teacher, so for every teacher that is entered into the database, the school's name will need to entered every time.  There are some inherent problems with this design:

To alleviate these problems, the design is modified to include two tables, Teachers and Schools:

Teacher_ID First_Name Last_Name School_ID Email
1 Jane Doe 1 jdoe@district...
2 John Doe 3 jdoe2@district...
3 Joe Teacher 2 jteacher@district...
 
School_ID School_Name School_Initials
1 A Elementary AES
2 B Middle BMS
3 C High CHS

A relationship between the two tables is defined such that for every unique School_ID entry in the Schools table, there may be many occurrences of School_ID in the Teachers table.  This is a one-to-many relationship as diagrammed below:

The field School_ID in the Teachers table is known as a foreign key.  If there are teachers that work at more than one school, how might the database design be modified to accommodate this?  View Answer