Re: Second Normal Form help.

From: James_one <James_one_at_deja.com>
Date: Thu, 29 Mar 2001 21:10:18 GMT
Message-ID: <_wNw6.271837$65.1466706_at_news1.rdc1.fl.home.com>


Is a concatenated primary key the same as a compound primary key?

"James_one" <James_one_at_deja.com> wrote in message news:LrNw6.271836$65.1466797_at_news1.rdc1.fl.home.com...
> Cool, thanks!
>
> "Tom" <Tom_at_webartisan.com> wrote in message
> news:9a077d$513$1_at_bob.news.rcn.net...
> > Yeah, that'll do it.
> >
> >
> > James_one <James_one_at_deja.com> wrote in message
> > news:U9Nw6.271828$65.1466503_at_news1.rdc1.fl.home.com...
> > > So Garages should have it's own unique key and then use BuildingID as
 a
> > > foreign key?
> > >
> > >
> > > "Tom" <Tom_at_webartisan.com> wrote in message
> > > news:9a06hm$1u0$1_at_bob.news.rcn.net...
> > > > Sure, Its valid in first normal form. To be in second normal form,
 all
> > > > non-key attributes need to be functionally dependant on the entire
 key,
 not
> > > > key combinations.
> > > >
> > > >
> > > > James_one <James_one_at_deja.com> wrote in message
> > > > news:WUMw6.271824$65.1466583_at_news1.rdc1.fl.home.com...
> > > > > Is that not a valid primary key, the combination of BuildingID and
> > > > > GarageNumber?
> > > > >
> > > > >
> > > > > "Tom" <Tom_at_webartisan.com> wrote in message
> > > > > news:9a04n7$nfo$1_at_bob.news.rcn.net...
> > > > > > .... If the BuildingId
> > > > > > was primary and unique throughout ...
> > > > > >
> > > > > > I meant GarageNumber. Sorry.
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > ...thats what you were asking, right?
> > > > > > >
> > > > > > > -tom
> > > > > > >
> > > > > > >
> > > > > > > James_one <James_one_at_deja.com> wrote in message
> > > > > > > news:GoMw6.271821$65.1466316_at_news1.rdc1.fl.home.com...
> > > > > > > > Here is a simplified version of a model I'm working on.
> > > > > > > > Buildings have many garages, and the garages can hold 1 or
 more
 trucks:
> > > > > > > >
> > > > > > > >
> > > > > > > > CREATE TABLE Buildings (
> > > > > > > > BuildingID int NOT NULL Primary Key ,
> > > > > > > > BuildingName char (20) NOT NULL )
> > > > > > > >
> > > > > > > > CREATE TABLE Garages (
> > > > > > > > BuildingID int NOT NULL REFERENCES Buildings(BuildingID),
> > > > > > > > GarageNumber int NOT NULL ,
> > > > > > > > Width int NOT NULL ,
> > > > > > > > Length int NOT NULL ,
> > > > > > > > Height int NOT NULL,
> > > > > > > > PRIMARY KEY (BuildingID, GarageNumber)
> > > > > > > > )
> > > > > > > >
> > > > > > > > CREATE TABLE Trucks (
> > > > > > > > VIN char (20) NOT NULL Primary Key,
> > > > > > > > TruckCapacity int NOT NULL ,
> > > > > > > > BuildingID int NOT NULL ,
> > > > > > > > GarageNumber int NOT NULL,
> > > > > > > > FOREIGN KEY
> > > > > > > > (BuildingID,GarageNumber)
> > > > > > > > REFERENCES Garages (BuildingID,GarageNumber)
> > > > > > > > )
> > > > > > > >
> > > > > > > >
> > > > > > > > My question is about the garages table. Is it in second
 normal
 form?
> > > > > > > > I mean do the dimensions(height width and length) of the
 garage
 depend
 on
> > > > > > > > the whole primary key of garages or just the garage number?
> > > > > > > >
> > > > > > > > Thanks in advance.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Received on Thu Mar 29 2001 - 23:10:18 CEST

Original text of this message