Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ER question

Re: ER question

From: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Thu, 6 May 2004 20:53:00 GMT
Message-ID: <409AA5AC.CC21B7A@remove_spam.peasland.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US