One to One
- Both Tables have only one association with one another.
- From a implementation perspective, this involves one table associating one of it’s columns as a foreign key to the primary key of another table.
One to Many
- One table (A) has a lot of associations with another table (B). However B only has one association with (A).
- From a implementation perspective, this involves the many table associating one of it’s columns as a foreign key to the primary key of the one table.
Many to Many
- Both tables have many relationships with one another. Example students can take many courses, and courses can have many students.
- To implement, we must use a joining table. The joining table with have foreign keys linked to the tables with many to many relationships.
Think about a row in a table to the rows in another table
- Say table A and B
- if table A row is connected to one table B row, then one to one
- if table A row is connected to many table B rows, then one to many
- if table A rows are connected to many table B rows, than many to many