Description of what I have to do
I have a table
that should be related to Table1 OR Table2 OR Table3
For instance, there's a table Employees
and it has:
Id,
Name,
Address,
Age,
Salary,
EmployerId
The second table is RegisterEmployeeRequirements
:
Id,
RequirementType,
EmployerId,
EntryId
.
Where requirement type could be CreditStatusRequirement
or EmployeeDegreeRequirement
).
The Problem: CreditStatusRequirement
includes both the CreditStatus
and the date it was acquired (to check if it was in the last year). I also have additional table which is named CreditStatusRequirements
with columns:
CreditStatus
,
DateTimeAcquired
On the other hand, the degree requirement which has the following properties: DegreeName and MinGpa
.
To solve this I created another table with these properties. If the requirement type in the RegisterEmployeeRequirements
is CreditStatusRequirement
I will use the entryId
column to look at the CreditStatusRequirements
table and then to check if it is completed.
Otherwise, if it is EmployeeDegreeRequirement
, I will use the entryId
column to look into DegreeRequirements
table. I suppose it is not a good practice to use such a column like entryId
.
What is the way to solve this architecture issue?