D
David
I have a need to set up a table or tables for departments
and sub-departments.
The design I came up with is a single table with 2 columns:
Department
Parent department
This allows all departments to be defined in the first
column and child departments to be defined by specifying a
parent. This simple arrangement allows hierarchies of any
complexity.
However in 'table relationships' it does not allow me to
link parent department to department and so enforce
referential integrity within the table.
Is there a better way to do this. I'd prefer to avoid
multiple tables if possible.
Any ideas appreciated.
- David
and sub-departments.
The design I came up with is a single table with 2 columns:
Department
Parent department
This allows all departments to be defined in the first
column and child departments to be defined by specifying a
parent. This simple arrangement allows hierarchies of any
complexity.
However in 'table relationships' it does not allow me to
link parent department to department and so enforce
referential integrity within the table.
Is there a better way to do this. I'd prefer to avoid
multiple tables if possible.
Any ideas appreciated.
- David