Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ER question
bcjm wrote:
>
> Say you have two tables, emp and dept. emp has dept_id foreign key
> which references dept table. What if I need to tract who is the
> department head? Do you add the emp_id to the dept table or do you
> create a indicator flag field in the emp table? Which way is better
> and why. Hope my question is clear.
>
> Thanks
The entity DEPT has a department head as one of its attributes. So the department head should be a column in the DEPT table. Since that department head is also an employee, you will most likely want a FK relationship between the dept head column in DEPT and the EMP_ID column of the EMP table.
HTH,
Brian
-- =================================================================== Brian Peasland dba_at_remove_spam.peasland.com Remove the "remove_spam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three"Received on Thu May 06 2004 - 15:53:00 CDT
![]() |
![]() |