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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Complex SQL

Re: Complex SQL

From: Ashish Mittal <mittalashish_at_yahoo.com>
Date: Tue, 02 Apr 2002 15:39:03 GMT
Message-ID: <rgkq8.180147$uA5.147874@rwcrnsc51.ops.asp.att.net>


Do not denormalize. Imagine doing a query which finds out the coach for all players in the system :)
"Marc Blum" <marc_at_marcblum.de> wrote in message news:3ca85f6e.1755754_at_news.online.de...
> On Mon, 1 Apr 2002 04:12:23 -0500, "Art Scott"
> <as33289898002323232_at_hotmail.com> wrote:
>
> >Team[TeamID(pk), coach, rating]
> >Player[PlayerID(pk), TeamID(fk)]
> >
> >Want to prevent data entry from having more than 12 players for each
team.
>
> Denormalize!
>
> CREATE TABLE team
> (
> teamid number primary key,
> coach varchar2(100) NOT NULL,
> rating varchar2(10),
> player_01 VARCHAR2(100),
> player_02 VARCHAR2(100),
> player_03 VARCHAR2(100),
> player_04 VARCHAR2(100),
> player_05 VARCHAR2(100),
> player_06 VARCHAR2(100),
> player_07 VARCHAR2(100),
> player_08 VARCHAR2(100),
> player_09 VARCHAR2(100),
> player_10 VARCHAR2(100),
> player_11 VARCHAR2(100),
> player_12 VARCHAR2(100)
> );
>
> Your business rule is:
> A team consists of 0 to 12 player.
> A team may not have more than 12 player.
>
> This structure enforces this business rule.
>
> What I don't know:
> A player may only belong to one and only one team.
> OR
> A player can belong to none, one or many teams.
> OR
> (Further possibilities...)
>
> regards
> Marc Blum
> mailto:marc_at_marcblum.de
> http://www.marcblum.de
Received on Tue Apr 02 2002 - 09:39:03 CST

Original text of this message

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