I work in a manufacturing facility and I am creating a database to track Production Downtime. We have several assembly lines working 3 shifts each day. I have the following table to record the Daily Production where the date, line and shift are the primary key in order to avoid duplication of data:
tblProduction:
ProductionDate (PKey)
LineID (PKey)
ShiftID (PKey)
ShiftLength
QtyProduced
QtyScrapped
QtyReworked
I have another table to record the Daily Downtime which could be for a number of different reasons:
tblDowntime:
DowntimeID (PKey-Autonum)
DowntimeReasonID
DowntimeMinutes
The problem is I am not sure what foreign key I should use in tblDowntime in order to create the relationship with tblProduction. Any ideas?
tblProduction:
ProductionDate (PKey)
LineID (PKey)
ShiftID (PKey)
ShiftLength
QtyProduced
QtyScrapped
QtyReworked
I have another table to record the Daily Downtime which could be for a number of different reasons:
tblDowntime:
DowntimeID (PKey-Autonum)
DowntimeReasonID
DowntimeMinutes
The problem is I am not sure what foreign key I should use in tblDowntime in order to create the relationship with tblProduction. Any ideas?