The difference between Primary key and Super key in DBMS

candidate-keyprimary-keyunique-constraint

I am new to DBMSs and I am still learning the theory.

I am getting really confused with this key business and after googling I have narrowed it down to just 2 keys I don't get (primary and super key).

I have a few questions on DBMS. I would be grateful if you can answer them for me.

1) What is the difference between Primary key and Super key in DBMS?
Highly appreciate it if you can use a comprehensive example to explain properly

2) Can Primary key and Super key both have multiple columns combined to form Primary key and Super key?

3) Is Primary key a subset of Super key or vice versa?

Best Answer

A Super Key is simply a non-minimal Candidate Key, that is to say one with additional columns not strictly required to ensure uniqueness of the row.

A Primary Key is a minimal Candidate Key, which is to say all constituent columns are strictly required in order to ensure uniqueness.

As a database developer/designer of 30 years experience, I had never even heard the term Super Key until I saw this question, and looked it up. The concept of Super Key seems more germane to the topic of performance and Physical Schema design as it directly maps to the concept of a unique nonclustered index with additional columns for improved query covering.