Re: Second Normal Form help.

From: Tom <Tom_at_webartisan.com>
Date: Thu, 29 Mar 2001 15:04:27 -0500
Message-ID: <9a04gh$mg7$1_at_bob.news.rcn.net>


You cant have a concatenated primary key and achieve 2NF. If the BuildingId was primary and unique throughout, and the BuildingID was foreign, I think you'd be ok then.

...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 - 22:04:27 CEST

Original text of this message