What is difference between a super key, a key, a candidate key and a primary key?

A super key specifies a uniqueness constrain that no two distinct tuples in a state

can have the same value for the super key. Every relation has at least one default super key.

A key is a minimal super key or the subset of the super key which is obtained after

removing redundancy. A relation schema may have more than one key .In this case

each key is called a candidate key. One of the candidate key with minimum number

of attributes is chosen as primary key.

Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key. Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.