Re: What is a Relationship !?
Date: Thu, 20 Nov 2003 19:25:11 -0500
Message-ID: <j8udnaOs3qktxiCi4p2dnA_at_golden.net>
"Lauri Pietarinen" <lauri.pietarinen_at_atbusiness.com> wrote in message
news:bpj3us$ebb$1_at_nyytiset.pp.htv.fi...
>
> >An entity is an object that exists and is distinguishable from other
> >objects. For instance, John Harris with S.I.N. 890-12-3456 is an entity,
as
> >he can be uniquely identified as one particular person in the universe.
> >
> >This is a pretty common notion. An entity exists in the real world and
has
> >a unique identifier. A relationship on the other hand is some subset of
the
> >power set of entities, or as DSS defines it: A relationship is an
> >association between several entities.
> >
> >Typically, relationships are identified by the identifiers of the
entities
> >that fill key roles in the relationship, not by any unique identifier of
> >their own. However, relationships do often have additional attributes
over
> >and above their member attributes.
> >
> By that definition most of the relations in a database could be
> classified as relationships, I guess...
> And, further, a relationship could become an entity just by giving it a
> unique identifier.
>
> Take for example
>
> person(person_id, person_name, etc...)
> company(company_id, company_name, etc...)
> job(person_id, company_id, etc...) //current job(s) of person
>
> Now would 'job' be an entity or a relationship?
Either. The distinction is arbitrary. Job is either an entity (the thing I got that came with a paycheck) or a relationship (my relationship with my employer).
> What if I add start_date?
No difference.
> job(person_id, company_id, start_date, etc...) //job history of person
>
> What if I add a surrogate key?
No difference.
> job(job_id, person_id, company_id, start_date, etc...) //job history of
> person
>
> Is this an entity or a relationship?
Either. Toss a coin or check your horoscope; whatever turns your crank.
> Even if a distinction could be made between these cases, what purpose
> would it
> serve? What do we care if 'job' is called a relationship or an entity?