MySQL Relationships

User – Device is a many-to-many relationship, so you’ll want to introduce an intermediary table to resolve that relationship. That table simply consists of two foreign keys, one referencing the User table and one referencing Device. Device – Location can be handled with a simple foreign key in the Device table pointing to a Location table.

enter image description here

Leave a Comment