I'm currently designing a database structure for a warehouse for an assignment.
Warehouse manager (*Manager name, manager salary, ^Warehouse managed)
Warehouse (*Warehouse ID, Address, ^Warehouse Manager, Number of Rooms)
Primary Keys: *
Foreign keys: ^
In the part above I want to make it such that when the manager is first hired the warehouse managed can be null, but when he manages the warehouse no one else can manage it. So the only thing coming to mind is to make the foreign key become a primary when set.
- A manager can only manage one or null warehouse.
- A warehouse must be managed by one manager.