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.
| 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,TruckHomeFireID->Alarms,AddressFiremanID->FiremanName,FiremanPhone,FiremanHomeStaion,StationAddress,StationPhoneWhich lead to...FIRE(FireID,Alarms,Address)FIREMAN(FiremanID,FiremanName,FiremanPhone,FiremanHomeStation,StationAddress,StationPhone)TRUCK(TruckID,License,TruckHome)Referencial Integriety StatementsFireID in FIRE_Report must exist in FireID in FIREFiremanID in FIRE_Report must exist in FiremanTruckID in FIRE_REPORT must exist in TruckID in TRUCKPlease, 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 KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
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 caseI 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. |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
|
|
|
|
|
|
|