Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1877

Re: Problem with E-R model

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Problem with E-R model
Date Fri, 06 Feb 2015 20:44:34 +0100
Organization Erland Sommarskog
Lines 31
Message-ID <XnsA439D301CA94Yazorman@127.0.0.1> (permalink)
References <mb2ua7$5im$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="416ef8a880b1e4f6f96e9a7c39a8d7a9"; logging-data="3052"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BIFhZcOBKYCLHYBIej+Zy"
User-Agent Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32)
Cancel-Lock sha1:AyOVl7E1JdIyq0NjtoWYysfb064=
Xref csiph.com comp.databases.ms-sqlserver:1877

Show key headers only | View raw


Tony Johansson (johansson.andersson@telia.com) writes:
> I have these relations one Rider can have many horses but one horse can
> only be owned by one rider.So here we have one to many counted from the
> Rider side. 

From what I have understood, a horse can be co-owned by several people.
And the rider does not necessarily own the horse at all. But it might
be that a horse typically only has one rider.

> For example
> Nisse Hult owns the two horses Trisdan and Sylfid.
> 
> In my current E-R design I can tell which horse the Rider is using in a 
> special class I can only know that Nisse Hult is using any of the horses 
> that he owns.

Not sure that I follow. If you tie the horse to the class, then you 
also know the rider. As long as we can assume that the horse can 
only have one rider. Since this is not my business domain, I am not
sure how safe this assumption is. Else you would need both horse, rider and 
class to be the key in that table.
 
> The other solution is that I can create a new table with is the contents
> of Horse and Rider and then remove the  Horse and Rider. 
> But if I do so I get a lot of double information as you can see here.

Right, as you have realised that is not the way should go.


-- 
Erland Sommarskog, Stockholm, esquel@sommarskog.se

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

Problem with E-R model "Tony Johansson" <johansson.andersson@telia.com> - 2015-02-06 18:40 +0100
  Re: Problem with E-R model Erland Sommarskog <esquel@sommarskog.se> - 2015-02-06 20:44 +0100

csiph-web