Multiple Google maps locations, column range, table relations

Hi

This is my setup:

I have a table of products

And I also have a table of restaurants where these products can be consumed or purchased. All of the restaurants have google location coordinates.

Each hotel or restaurant serves a number of products, e.g. honey, butter, cheese, etc. Therefore it cannot be only one single product per restaurant.

Now, when I access product detailed view, I want to show a link to a map of all the restaurants where this specific product is served. It usually is more than one. This link should say “Where to eat”.

How do I approach this problem?

If you know any expressions, pleas show me how to add them, because I am still a begginer.

Thank you.

0 4 308
4 REPLIES 4

You’ll need to define a “many to many relationship” between the Products Table, and the Establishments Table. I’d highly recommend the so called “database normal form”, where you make a new Table to hold all of the associations. Each record in this new Table, often called an “association table”, will link a single Product to a single Establishment, but there can be any number of records for each Product and/or Establishment.

For further details please search the words/phrases that I put in quotes, both on google, and here in this community.

Yes. I see the logic behind this approach. But there are 120 establishments and 80 products. With all of the variations, the table would need to be huge and it would take a lot of time to build.

I did some research based on your suggestions. Would this approach be viable in my case: Many-to-Many Relationships

Looks like I would be able to have multiple entries in one cell and still establish relations.

Thank you.

It really depends on how complex of functionality you’re expecting to utilize across these many-to-many relationships. I’ve used both. Most of the time that I use EnumLists, I end up regretting not setting up the association Table from the beginning. But then again, I also often implement more complex functionality, which is precisely when it stings me.

Well, all I want is to have a link that takes me to the restaurants where those products can be consumed.

Top Labels in this Space