Table locations contains locID, lat & long & name values of a certain location.
Table categories contains ID, category-name & locID.
How do I make categories assignable to multiple locations?
It doesn’t make sense to have the same category stored multiple times, once for every locID.
You can use a join table to model the many-to-many relationship.
Add foreign key constraints to prevent invalid values from being entered into the table:
location_category.location_idtolocations.locIDlocation_category.category_idtocategories.IDAlso make
(location_id, category_id)the primary key for the table to prevent adding a category to the same location multiple times.When reading the data from the table, use JOINs to get the related data from the main tables: