Entity modelling - newbie question.
Date: 12 Jan 2002 12:21:12 -0800
Message-ID: <3811f825.0201121221.7158e7fb_at_posting.google.com>
Hi there,
I'm new to entity modelling and am currently looking at an example of a database schema that is not consistent with what I thought previously.
It is from "SQL the complete reference"
Offices: SalesReps:
Office(PK) Empl_Num(PK) City Name Mgr(FK) Age Target Rep_Office(FK) Sales Title Hire_Date
--------------------------
PK=Primary Key
FK=Foreign Key
the entity constraints are:
Rep_Office(FK) references Office(PK)
and Mgr(FK) references Empl_Num(PK)
I can see the basic thing that : Rep_Office(FK) references Office(PK) models the fact that there are 'many' Salesreps associated with any 'one' office.
What does: Mgr(FK) references Empl_Num(PK) mean?
My understanding is that the Foreign Key models the child and the Primary Key models the parent in the above, and thus, it is modeling the fact that every SalesRep has many managers whereas this should be the other way around, and even if it was the other way around i.e that Empl_Num somehow referenced Mgr in a FK to PK way(to model the fact that many SalesReps have one mgr),
then this would be nonsense looking at the schema presented above.Can someone please shed some light on this for me?
thanks in advance ,
Borris.
Received on Sat Jan 12 2002 - 21:21:12 CET