Skip to content

Relationship Sets

One-One

A foreign key to either table is stored in the other table

riverriver_IDnamedamdam_IDnamebuilt on

dam(dam_ID, name, river_ID) river(river_ID, name) {either one can work}

Many-One

A foreign key to the "one" table is stored in the "many" table

riverriver_IDnamestreamstream_IDwidthflows into

stream(stream_ID, width, river_ID) flows_into(stream_ID, river_ID)

Many-Many

A new table is made to store the information of the relationship

riverriver_IDnamecitycity_IDpopulationflows through

river(stream_ID, name) city(city_ID, population) flows_through(river_ID, city_ID)