Assume that a table have 4 columns A, B, C and D. Only A column defines uniqueness that’s why it’s a primary key. B, C and D allow entries to repeat that’s why we can’t take them as an composite alternate key. Is it possible to use the same column in primary key and alternate key, say, to make a alternate key as (A and B)?
Share
Unless I didn’t get your idea, for MS SQL it’s quite possible, look at this test:
The result is as following:
1 1
2 1
3 1
4 NULL
5 NULL
6 NULL