MySQL Relationships

前端 未结 1 985
不思量自难忘°
不思量自难忘° 2020-12-03 12:52

I am trying to figure out how to structure this database. I have used Apple\'s core data before just fine, I\'m just working on a different project now that requires MySQL.

相关标签:
1条回答
  • 2020-12-03 13:34

    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

    0 讨论(0)
提交回复
热议问题