jeudi 7 juillet 2016

Two links between 2 tables

I have 2 tables in my database that I'm trying to design in mysql workbench.

1 table - Company

 1. ID
 2. Company
 3. Company_Number
 4. Created_Date

2 table - Employees

 1. ID
 2. Employee
 3. Company_Number
 4. Created_Date

I want to create a relationship between Company and Employees. 1 Company can have multiple employees. The problem is that I cannot make Company_Number as a primary key since those keys might duplicate since data will be dumped in daily. Also one employee can work for multiple employees but for each company he/she will have an additional row with data.

Is there a way to make 2 relationships between those two tables? 1 to 1 created_date - created_date & one to many company_number to company_number

Aucun commentaire:

Enregistrer un commentaire