D
David M C
I'm designing a database to keep track of which employee has which piece of
equipment. It needs to keep store who has what at any one time but also a
record of who has "hired" a piece of equipment in the past and when it was
returned.
So far, I think it can be done with three tables:
tblPlant:
pkPlantID
PlantName
PlantDescription
Available (might not need this one)
tblPlantHireDetails:
fkPlantID
HireDate
fkEmployeeID
ExpectedReturnDate
ReturnDate
tblEmployees:
pkEmployeeID
FirstName
LastName
etc
Can you see any problems with the table design, especially with regards to
keeping track of which employee has which piece of equipment? What should I
use as a Primary Key in the PlantHireDetails table? I was thinking a
composite key of EmployeeID, PlantID and HireDate?
What if I wanted to give an "OnHire" number (much like an order number) to
group multiple items on hire a single requisition record? This would require
a table between tblPlant and tblPlantHireDetails with a design similar to
that of the Northwind tblOrder and tblOrderDetails. Normalising the database
with this extra table is fairly simple, but keeping the design simple enough
to correctly handle and record the return of equipment has made my head go
blank.
Any ideas or input would be appreciated.
Thanks
Dave
equipment. It needs to keep store who has what at any one time but also a
record of who has "hired" a piece of equipment in the past and when it was
returned.
So far, I think it can be done with three tables:
tblPlant:
pkPlantID
PlantName
PlantDescription
Available (might not need this one)
tblPlantHireDetails:
fkPlantID
HireDate
fkEmployeeID
ExpectedReturnDate
ReturnDate
tblEmployees:
pkEmployeeID
FirstName
LastName
etc
Can you see any problems with the table design, especially with regards to
keeping track of which employee has which piece of equipment? What should I
use as a Primary Key in the PlantHireDetails table? I was thinking a
composite key of EmployeeID, PlantID and HireDate?
What if I wanted to give an "OnHire" number (much like an order number) to
group multiple items on hire a single requisition record? This would require
a table between tblPlant and tblPlantHireDetails with a design similar to
that of the Northwind tblOrder and tblOrderDetails. Normalising the database
with this extra table is fairly simple, but keeping the design simple enough
to correctly handle and record the return of equipment has made my head go
blank.
Any ideas or input would be appreciated.
Thanks
Dave