Primary key

  • Thread starter Thread starter cameron
  • Start date Start date
C

cameron

Guest
is there any disadvantage in having 3 primary keys that anyone can think off
thanx
 
Just to clarify your terminology, you can only have one primary key per table, although it can be composed of several columns.

There is nothing wrong with this sort of arrangement, and it is quite common when recording histories, for example, if you wanted to record the number of units produced by each factory worker on a production line you might have a table with these columns:

WorkerID
Date
UnitType
UnitsProduced

Note: the worker may work on several different types of units during a single day.

The primary key would encompass the first three columns, as these are expected to be unique.
 
Index every field that your going to sort on.
 

Users who are viewing this thread

Back
Top Bottom