0

Before I can create a shipment to a particular address it first needs to be defined in a supplier database, after which supplier provides me an supplier_addr_id for this particular address. I need to map supplier_addr_id to either shop_id or employee_id.

Relationships

My problem is that I need to be able to map supplier_addr_id to shop_id without specifying employee_id and to map supplier_addr_id to employee_id without specifying shop_id. Should I just create two seperate tables supplier_addr_shop_map and supplier_addr_employee_map?

What would be the best appropach here?

Betech41
  • 17
  • 5
  • Map to a `addr_id`. And have `shop` and `supplier` map to it, too. – Rick James May 21 '22 at 21:13
  • 1
    Where are you 1st stuck in what published presentation of what design method? PS . [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/q/285551/3404097) [Why are images of text, code and mathematical expressions discouraged?](https://meta.stackexchange.com/q/320052/266284) – philipxy May 21 '22 at 21:26
  • Does this answer your question? [How can you represent inheritance in a database?](https://stackoverflow.com/questions/3579079/how-can-you-represent-inheritance-in-a-database) – philipxy May 22 '22 at 02:15
  • [Strategy for “Which is better” questions](https://meta.stackexchange.com/q/204461/266284) [Why is asking a question on "best practice" a bad thing?](https://meta.stackexchange.com/q/142353/266284) [ask] [Help] – philipxy May 22 '22 at 02:16

0 Answers0