Home > Software engineering >  How to map schema of a table has two different type of relationship with same table from ERD?
How to map schema of a table has two different type of relationship with same table from ERD?

Time:04-08

I am going through the Entity relationship diagram. I just stuck at one point to understand that is if you look at the picture there are Employees and Equipment entities. Employees are connected with Equipment using INSPECT and USE relationship. Just wondering how to write SQL schema in this case. Can anyone help me, please?

enter image description here

CodePudding user response:

In transforming ERD to a schema, you will split the two relations into 2 ForignKey columns in the equipment table as ex: used_by and inspected_by and both are FK represents employee_id

Hope this answers your question

  • Related