Hi all,
I wish to define a hierarchical relation in a table or set of tables. I'll use an example to describe the problem.
In a hotel there is One Manager(M), Assistant Managers(AMs) and a Deputy Managers(DMs) and each of them can recruit
executives for the hotel.
1. The Manager(M) can recruit the AMs and the DMs.
2. Further the AM can recruit a DM which must be approved(AP_M) by the Manager. // AP_M -> field for approval by the Manager
3. The AM can directly recruit executives and they must also be approved by the Manager.(AP_M)
4. The DM can recruit executives and they must be approved by the AM (AP_AM) and the Manager (AP_M). // AP_AM -> approval by AM
Further :
a) The Manager can view the performance(P) of all the AMs, DMs, and executives in the hotel whether recruited by himself
or by the AMs or DMs.
b) An AM can view the performance (P) of all the DMs that he recruits, all executives recruited by his DM's and
all executives recruited by the AM directly.
c) The Manager cannot recruit executives. That is done by the AM and DM.
Please can someone help me define the table/tables and help implement these relations in them.
Thanks all!