Second Normal Form help.

From: James_one <James_one_at_deja.com>
Date: Thu, 29 Mar 2001 19:53:10 GMT
Message-ID: <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 - 21:53:10 CEST

Original text of this message