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
 Please look @ my normalization

Author  Topic 

zipwirebe
Starting Member

1 Post

Posted - 2008-03-06 : 01:35:40
I'm working on a normalization for one of my classes and I've been sick and I feel lost now, could one of you please look at my database statements and tell me if/what is wrong with it?

FIRE_REPORT(FireID,Alarms,Address,FiremanID,FiremanName,FiremanPhone,FiremanHomeStation,StationAddress,StationPhone,TruckID,License,TruckHomeStation)

I came up with..

TruckID->License,TruckHome
FireID->Alarms,Address
FiremanID->FiremanName,FiremanPhone,FiremanHomeStaion,StationAddress,StationPhone

Which lead to...

FIRE(FireID,Alarms,Address)
FIREMAN(FiremanID,FiremanName,FiremanPhone,FiremanHomeStation,StationAddress,StationPhone)
TRUCK(TruckID,License,TruckHome)

Referencial Integriety Statements

FireID in FIRE_Report must exist in FireID in FIRE

FiremanID in FIRE_Report must exist in Fireman

TruckID in FIRE_REPORT must exist in TruckID in TRUCK


Please, someone tell me if this is right or not. -cheers

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-03-06 : 02:13:07
I think you should have a FIRESTATION table too, with a foreign key to FIREMAN and TRUCK.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-03-06 : 02:29:18
Try to make a star diagram or as many flat tables as possible. So in your case

I would go:
Truck_Tbl (TruckID, License, FK_StationID)
Fireman_Tbl (FiremanID, FiremanName, FiremanPhone, FK_StationID)
Station_Tbl (StationID, StationAddress, StationPhone)
Fire_Tbl (FireID, Alarms, Address)
FireFireman_Tbl (Fire_FiremanID, FK_FiremanID, DateTime)

That's it.
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-03-17 : 02:07:16
Serious cross-posting of RFH:
http://www.dbforums.com/showthread.php?t=1628048
http://www.go4expert.com/forums/showthread.php?t=9390
http://forums.databasejournal.com/showthread.php?p=120175
http://news.devx.com/showthread.php?t=166833
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98524


e4 d5 xd5 Nf6
Go to Top of Page
   

- Advertisement -