-1

I have the following diagram: enter image description here

That I have to translate into conceptual model using mySQL workbench. But how can I do? In workbench, while creating eer model, the is no option to define super types and subtypes. So how would you represent it?

How would you continue?

How to continue?

Jenny
  • 259
  • 1
  • 2
  • 12

1 Answers1

0

Relations between supertypes and subtypes have nothing specific:

You can create a table Manager with SSN as foreign key and thus have a relation 0..1 between those two table

DonKnacki
  • 427
  • 4
  • 11
  • So I should create 3 different tables, PERSON, CLIENT and MANAGER, where PERSON is connected to CLIENT(and MANAGER) with 1:M non identifying relationship? – Jenny Apr 02 '21 at 13:35
  • yes, if you really want to have PERSON table. You can read [this answer](https://stackoverflow.com/questions/1567935/how-to-do-inheritance-modeling-in-relational-databases) to have more info about other solutions – DonKnacki Apr 02 '21 at 14:12
  • The problem is that in this way, if I enter a person with PK 03, for example, then I can add both a Manager and a customer with the same PK 03. Instead I would like that sql give me error if I try to add both customer and manager with the same PK. Persons's PK should be used just from A customer or A manager, not both – Jenny Apr 03 '21 at 09:52
  • You can create a trigger to avoid such case: – DonKnacki Apr 03 '21 at 21:30