Pergunta de entrevista da empresa GlobalLogic

What are super, primary, candidate and foreign keys?

Resposta da entrevista

Sigiloso

13 de ago. de 2020

A super key is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes. A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey. A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table. A Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.