Table Relationship?
I made a Campsite DB. One table is "Campground", another is "Restaurants". In the Campground table I want to link (show) nearby Restaurants. Problem I've encountered is once I link one restaurant to one campground then I can't use that restaurant again for another nearby campground. What type of table relationship do I need to set up for this to work?
5 replies
-
Hi This is a many to many relationship. If you ask, can a campsite have more than one restaurant nearby and can a restaurant be close to more than one campsite and the answer is yes to both then you have a many-to-many relationship on your hands. It's a common construct and easy to implement. With campsites on one side and restaurants on the other side, a join table sits between them. It has two relationship fields, one to each of the two main tables and can hold additional information that pertains to the join, eg distance, travel time. The data is shown from the point of view of the join table for each main tables, showing the other side.
I can put something together for you if you want to see what this looks like.
Regards John
Content aside
- 2 hrs agoLast active
- 5Replies
- 13Views
-
3
Following
