I am creating a database that will be used to track employees, computer inventory and the positions allocated to my division. I currently have three tables created as follows:
Position#TBL:
- Position# (primary key)
- ReportsTo
- FormalTitle
- WorkingTitle
- classification
- FundingSource
- EmployeeNumber
EmployeeTBL:
- Employee Number (primary key)
- LastName
- FirstName
- HireDate
- Position#
- PC#
ComputerInventoryTBL:
- PC# (primary key)
- Make
- Series
- ModelNumber
- ServiceTag
- OperatingSystem
- EmployeeNumber
The following business rules apply:
- We have a defined number of positions in our division, each has been assigned a unique position number.
- Each position number can have only one employee assigned to it at a time but over time, multiple employees will be assigned. We are not especially concerned about tracking what employees have historically been assigned to that position number.
- Position numbers may not have any employee assigned if the position is vacant.
- Each employee has a unique employee ID that stays with that employee forever.
- An employee can only be assigned to one position number at a time but over time can be assigned to multiple position numbers. We are not especially concerned about tracking what position numbers an employee has been assigned.
- Each employee can only be assigned to one PC at a time but over time can have multiple PCs assigned to them. We are not especially concerned about tracking all of the PCs an employee has been assigned to historically.
- Each PC has a unique PC#.
- Each PC can be assigned to only one employee at a time but over time, a PC can be assigned to multiple employees. We are not concerned about tracking all the employees a PC has been assigned to historically.
- PCs can be retired so I think I need a checkbox field to identify if a specific PC is active or not.
- Employees come and go so I think I also need a checkbox field to identify if an employee is active or not.
My main questions right now are about relationships between the tables.
- It seems fairly obvious to me that the EmployeeNumber field in the EmployeeTBL should be linked to the EmployeeNumber fields in both the Position#TBL and the ComputerInventoryTBL. Should that be a 1-to-1 or 1-to-Many relationship?
- It also seems fairly obvious that the Postion# field in the Position#TBL should be linked to the Position# field in the EmployeeTBL and the PC# field in the ComputerInventoryTBL should be linked to the PC# field in the EmployeeTBL. Same question as above, should these be 1-to-1 or 1-to-many relationships?
- If I create these relationship, shouldn't the data that I have in the EmployeeTBL automatically fill the corresponding fields in the other two tables? Ultimately I plan to create an entry form that will be used to add a new employee and assign them a PC and position number or it will be used to change an existing employee.
I've tried to create databases in the past but I always seem to get hung up on the relationship piece. Any help would be greatly appreciated!