Reputation: 31
I have been looking for information across the web and books and cant seem to find any information on this. From my understanding of primary keys it is not possible. But can all columns in a table be used as a combined primary key. By this I mean I have a table with 6 columns can all six columns be used as a combined primary key.
Upvotes: 1
Views: 132
Reputation: 25526
It is quite possible for a table to consist of just a key and to have no non-key attributes. Semantically such a table identifies the existence of entities without recording any additional information about them. Examples might be a table of IP addresses authorised to access a system or a table or co-ordinates identifying points in an N-dimensional space. In order to update, delete or retrieve an individual tuple in such a table the full set of values for the tuple has to be specified.
Upvotes: 2
Reputation: 466
In Oracle you could do this:
alter table table_name add constraint table_name_pk primary key(column1, column2, column3, column4, column5, column6);
In Oracle, composite primary key constraints are limited to 32 columns.
Refer to this:
http://docs.oracle.com/cd/B10500_01/server.920/a96524/c22integ.htm
Upvotes: 0