Selection of primary key

NaveenNandigam

Registered User.
Local time
Today, 14:08
Joined
Mar 31, 2005
Messages
14
Hi, I have current yards table with Trailer number as the primary key and which cannot have duplicates. When this trailer leaves the yard we send this record to History table. Now if a trailer comes again and leaves History table is not accepting as it is duplicating. So can anyone help in designing table so that it accepts duplicate trailer numbers only in the history table.


Thank You,
Naveen
 
You have two tables. The Current Yards Table should, indeed, have the Trailer Number as its prime key.

The Yards History Table should have Trailer Number and Date Arrived (or Date Departed) as its prime (compound) key.
 
Didnt use my head!! Dont worry I got it now ;)
 

Users who are viewing this thread

Back
Top Bottom