Re: Entity modelling - newbie question.

From: Kieran Elby <kieran_at_dunelm.org.uk>
Date: Sun, 13 Jan 2002 21:36:38 +0000
Message-ID: <3C41FDE6.23E7F05F_at_dunelm.org.uk>


Borris -

I think this is simply a poorly chosen example that does not correspond to most people's real-world experience.

I'd interpret it to mean that each office has one manager, who will himself be a sales rep.

Regards,
Kieran Elby

borris wrote:
>
> 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 Sun Jan 13 2002 - 22:36:38 CET

Original text of this message