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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DB Design - Which ID to use

Author  Topic 

TSQLMan
Posting Yak Master

160 Posts

Posted - 2003-09-15 : 10:39:54
I am in the process of designing a database for a shipments application.

I have a shipments table with seperate ID's that point to other tables, Each one of the these tables is linked to the shipment table by their primary key back to a key of the same name within the shipments table.

eg. ShipmentID
Shipment.TrainID (1 --- many) Train.TrainID
Shipment.DestinationID (1 --- many) Destination.DestinationID

I am wondering in what case would I want to link the shipments table to another table by ShipmentID.

eg. ShipmentShipmentID (1 --- many) Analysis.ShipmentID
Shipments.ShipmentsID (1 --- many) Destination.ShipmentID


If I didn't make myself clear enough, please feel free to E-mail, or respond.

Thanks,


JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2003-09-15 : 10:46:45
Shipment line items springs to mind.

Shipment.ShipmentID -> ShipmentContents.ShipmentID

MOO,
Justin

"Look at it out there orbiting like it's so cool, we will rule it with an army of replicants!"
Go to Top of Page

TSQLMan
Posting Yak Master

160 Posts

Posted - 2003-09-15 : 11:50:35
Just found a good article on the Five Steps of Database Normalization. Think I answered my own question. That happens a lot especially when I talk to myself.

1.) First Normal Form - Create a Primary Incremented Key for each table with more than one record.
2.) Second Normal Form - Create separate tables for sets of values that apply to multiple records. Relate these tables with a foreign key.
3.) Third Normal Form - Eliminate fields that do not depend on the key.
4.) In a many-to-many relationship, independent entities can not be stored in the same table
5.) Fifth Normal Form - The original table must be reconstructed from the tables into which it has been broken down.




Go to Top of Page
   

- Advertisement -