Most of the reference books recommend autonum primary keys, but the
Access help says that any unique keys will work.
What are the tradeoffs?
I have several tables that have unique fields. Can I use them as
primary keys or should I define an autonum primary key?
One table has information about the 50 states in the US. The table
looks like this:
State Capitol Date Admitted
Alabama Montgomery December 14, 1819
Alaska Juneau January 3, 1959
Arizona Phoenix February 14, 1912
Since the state names are unique, is there any reason not to make that
field the primary key?
Another table has to do with grade school multiplication tables. This
is a simple table something like this:
Factors Answer
1x1 1
2x1 2
2x2 4
3x1 3
3x2 6
3x3 9
...
12x1 12
12x2 24
...
12x12 144
Here again, the Factors field (a text field) is unique. Is there any
reason not to use it as the primary key?
In both cases, the tables are small, so adding another 4-byte field is
no big deal, but I'd like to keep the tables as simple as possible
unless there is some downside.
Thanks
--
Running MS Office 2000 Pro on Win2000
Access help says that any unique keys will work.
What are the tradeoffs?
I have several tables that have unique fields. Can I use them as
primary keys or should I define an autonum primary key?
One table has information about the 50 states in the US. The table
looks like this:
State Capitol Date Admitted
Alabama Montgomery December 14, 1819
Alaska Juneau January 3, 1959
Arizona Phoenix February 14, 1912
Since the state names are unique, is there any reason not to make that
field the primary key?
Another table has to do with grade school multiplication tables. This
is a simple table something like this:
Factors Answer
1x1 1
2x1 2
2x2 4
3x1 3
3x2 6
3x3 9
...
12x1 12
12x2 24
...
12x12 144
Here again, the Factors field (a text field) is unique. Is there any
reason not to use it as the primary key?
In both cases, the tables are small, so adding another 4-byte field is
no big deal, but I'd like to keep the tables as simple as possible
unless there is some downside.
Thanks
--
Running MS Office 2000 Pro on Win2000
Comment