Re: Second Normal Form help.

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 30 Mar 2001 08:24:10 GMT
Message-ID: <9a1fra$qgb$1_at_news.tue.nl>


Ton wrote:
> James_one <James_one_at_deja.com> wrote in message
> news:GoMw6.271821$65.1466316_at_news1.rdc1.fl.home.com...
> >
> > [...]
> >
> > 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)
> > )
> >
> > [...]
> >
> > My question is about the garages table. Is it in second normal form?

Yes, it is. As long as there are no other candidate keys then the primary key, and the attributes width, length and height are not functionally dependent on just the garage number ot the buildingID.

> > 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?

That depends of course on the situation you are modelling. They might and they might not. But normally a single building will probably contain garages of different sizes and garages with the same number can have different sizes in different buildings. So the answer is probably 'yes, they depend on the whole primary key'.

> > You cant have a concatenated primary key and achieve 2NF.

Wrong. Having a composed primary key is by itself not a problem in 2NF.

-- 
  Jan Hidders
Received on Fri Mar 30 2001 - 10:24:10 CEST

Original text of this message