Primary key (1 Viewer)

C

cameron

Guest
is there any disadvantage in having 3 primary keys that anyone can think off
thanx
 

ritchieroo

Registered User.
Local time
Today, 01:23
Joined
Aug 2, 2002
Messages
80
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.
 

llkhoutx

Registered User.
Local time
Yesterday, 19:23
Joined
Feb 26, 2001
Messages
4,018
Index every field that your going to sort on.
 

Users who are viewing this thread

Top Bottom