The Stoat
The Grim Squeaker
- Local time
- Today, 19:48
- Joined
- May 26, 2004
- Messages
- 239
Hi all,
I'm a bit stuck with a db relationship design.
I need to hold information in a staff table about a person's Line-manager.
My initial idea was to just have the Staff Table and use the PK of a member who is a Line-manager as a FK in the Line-manager field in the same table for their staff.
I then came across a problem.
I need to be able to select all the staff under a Line-manager. For example a head of department may have 3 team leaders who each manage 10 staff. I need to know all of them, not just the 3 team leaders who are directly managed by the HoD but their staff as well.
As it happens there is no rigidgly defined managment structure per se for this organisation which makes things even more difficult.
I assume there is a reasonably standard way of doing this as all organisations have some form of line-manager/staff relationship. Anyone care to enlighten me?
Cheers
TS
I'm a bit stuck with a db relationship design.
I need to hold information in a staff table about a person's Line-manager.
My initial idea was to just have the Staff Table and use the PK of a member who is a Line-manager as a FK in the Line-manager field in the same table for their staff.
I then came across a problem.
I need to be able to select all the staff under a Line-manager. For example a head of department may have 3 team leaders who each manage 10 staff. I need to know all of them, not just the 3 team leaders who are directly managed by the HoD but their staff as well.
As it happens there is no rigidgly defined managment structure per se for this organisation which makes things even more difficult.
I assume there is a reasonably standard way of doing this as all organisations have some form of line-manager/staff relationship. Anyone care to enlighten me?
Cheers
TS