Allen Johnson
Allen Johnson

Reputation: 1

Link multiple tables together so that changing one references another

We have a database with tables MEMBERS, BOATS and STORAGE. Members can have multiple boats and storage spaces. They are all tied to the MEMBERS table by the MEMNO key. I'd like to have it so that a storage space links the boat in that space and the member. So that you can assign a boat to a storage spot as well as MEMNO. Right now we know members have boats A & B and storage spots 5 & 6, but I can't seem to come up with a way to know that boat A is in spot 6 and boat B is in spot 5. Is there a way to do this?

Upvotes: 0

Views: 26

Answers (1)

BitAccesser
BitAccesser

Reputation: 719

The PrimaryKey of STORAGE should be a ForeignKey in BOATS, then you know where the Boat is stored.

Upvotes: 1

Related Questions