SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Did I normalize correctly?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ushynnad
Starting Member

1 Posts

Posted - 10/25/2013 :  18:28:59  Show Profile  Reply with Quote
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

Edited by - ushynnad on 10/25/2013 18:30:13

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 10/26/2013 :  00:55:45  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000