Question

Consider the following ERD:

ERD

Suppose that all entities only have two attributes: a PK plus a name/number.


I want to convert that ERD to tables.

  • Is it needed 4 tables (1 for each relationship plus the phone table)? Is there a better solution?

Here is my solution (4 tables, one for each relationship plus the phone table):

Relationship 1 (R1)
-----------------------------------------
ID_PhoneNumber | ID_Company | CompanyName
-----------------------------------------

Relationship 2 (R2)
-------------------------------------------
ID_PhoneNumber | ID_Employee | EmployeeName
-------------------------------------------

Relationship 3 (R3)
-------------------------------------------
ID_PhoneNumber | ID_Supplier | SupplierName
-------------------------------------------

Telephone
----------------------------
ID_PhoneNumber | PhoneNumber
----------------------------

I assumed that is not needed to add three more tables, one for each entity (Company, Employee, Supplier) since those entities are already represented by the tables of each relationship (R1, R2, R3).

I'm not sure if that decision is correct or if I'm making good use of the fundamental concepts (maybe I'm lacking some).

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top