1DBMS Keys - Primary, Foreign, Candidate and Super Key - Javatpoint PDF
1DBMS Keys - Primary, Foreign, Candidate and Super Key - Javatpoint PDF
ADVERTISEMENT BY ADRECOVER
Keys
Keys play an important role in the relational database.
Types of key:
https://www.javatpoint.com/dbms-keys 1/8
12/17/2020 DBMS Keys: Primary, Foreign, Candidate and Super Key - javatpoint
1. Primary key
It is the first key which is used to identify one and only one
instance of an entity uniquely. An entity can contain multiple keys
as we saw in PERSON table. The key which is most suitable from
those lists become a primary key.
https://www.javatpoint.com/dbms-keys 2/8
12/17/2020 DBMS Keys: Primary, Foreign, Candidate and Super Key - javatpoint
2. Candidate key
For example: In the EMPLOYEE table, id is best suited for the primary
key. Rest of the attributes like SSN, Passport_Number, and
License_Number, etc. are considered as a candidate key.
3. Super Key
4. Foreign key ⇧
https://www.javatpoint.com/dbms-keys 3/8
12/17/2020 DBMS Keys: Primary, Foreign, Candidate and Super Key - javatpoint
Foreign keys are the column of the table which is used to point to
the primary key of another table.
← prev next →
ADVERTISEMENT BY ADRECOVER
https://www.javatpoint.com/dbms-keys 4/8