Re: A foreign key on a self-referring table

From: mAsterdam <mAsterdam_at_vrijdag.org>
Date: Sat, 06 Mar 2004 21:36:53 +0100
Message-ID: <404a3671$0$561$e4fe514c_at_news.xs4all.nl>


daveb wrote:

> "mAsterdam" <mAsterdam_at_vrijdag.org> wrote in message
> news:404a1860$0$573$e4fe514c_at_news.xs4all.nl...
>
>

>>+------------------+
>>| Reports_To       |
>>+------+-----------+
>>| EMP# | MGR_EMP#  |
>>+======+===========+
>>|    2 |         1 |
>>|    3 |         1 |
>>|    4 |         3 |
>>|    5 |         2 |
>>|    6 |         3 |
>>|    7 |         2 |
>>+------+-----------+
>>
>>, the predicate being
>>
>>"Employee with number (EMP#) reports to employee with number (MGR_EMP#)"
>>
>>Aside: There is a reason why I still would not have
>>this in a real database:
>>What if a managerspositon is vacant? But
>>that may be another topic.

>
> Well, it changes the functional dependencies; we now find that employees
> report to a department, not to a manager, and the OrganizationChart relates
> departments, not employees.

That is not enough.
An employee should be somehow associated with a department. A deparment should be able but not obliged to be associated with an employee as its manager. I still don't see "OrganizationChart" as a good name for its association with other departments. Received on Sat Mar 06 2004 - 21:36:53 CET

Original text of this message