Ankit
Ankit

Reputation: 639

In what situation would I be forced to use primary key or a unique key?

I've googled about the differences between pk and uk. I've read QA on stackoverflow regarding the pk and uk.

Can please anyone in simple terms briefly tell me in what situation would i be preferring pk over uk or vice -versa.

Regards, Ankit

Upvotes: 0

Views: 99

Answers (1)

whywake
whywake

Reputation: 910

If your column has all the distinct values and all not null values, use primary key and if it can insert only one null value along with all other distinct values, consider using unique key.

Upvotes: 1

Related Questions