Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Did I normalize correctly?

Author  Topic 

ushynnad
Starting Member

1 Post

Posted - 2013-10-25 : 18:28:59
How it originally started: FIRE_REPORT(FireID, Alarms, Adddress, FiremanID, FiremanName, FiremanPhone, FiremanHomeStation, StationAddress, StationPhone, TruckID, LicensePlate)

The Assumptions:
1. each fire can have several firefighters assigned to it
2. each fire can have several fire trucks assigned to it
3. each firefighter can be assigned to several fires
4. each fire truck can be assigned to several fires
5. each firefighter has a single home station
6. each station name is unique
7. each station has a single phone number

FIRE_REPORT (FireID, FiremanID, TruckID)

(FireID, FiremanID, TruckID) -- (Alarms, Address, FiremanName, FiremanPhone, FiremanHomeStation, StationAddress, StationPhone, LicensePlate)

FiremanID -- (FiremanName, FiremanPhone, FiremanHomeStation, StationAddress, StationPhone)

FIREMAN (FiremanID, FiremanName, FiremanPhone, FiremanHomeStation)

FiremanID in FIRE_REPORT must exist in FiremanID in FIREMAN

FireID -- (Alarms, Address)

FIRE (FireID, Alarms, Address)

FireID in FIRE_REPORT must exist in FireID in FIRE

TruckID -- LicensePlate

TRUCK (TruckID, LicensePlate)

TruckID in FIRE_REPORT must exist in TruckID in TRUCK

FiremanHomeStation -- (StationAddress, StationPhone)

STATION (FiremanHomeStation, StationAddress, StationPhone)

FiremanHomeStation in FIREMAN must exist in FiremanHomeStation in STATION

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-26 : 00:55:45
I would have done it like this
FIRE_REPORT (FIREID,FIREMANID,TRUCKID)
FIRE (FIREID,Alarms,Adddress)
FIREMAN (FiremanID,FiremanName,FiremanPhone,FiremanHomeStationID)
STATION (StationID,Station,StationAddress,StationPhone)
TRUCK (TruckID,LicensePlate)

Relationships
FIRE_REPORT.FireID -> FIRE.FireID
FIRE_REPORT.FiremanID -> FIREMAN.FiremanID
FIRE_REPORT.TruckID -> TRUCK.TruckID
FIREMAN.FiremanHomeStationID -> STATION.StationID

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -