2

Types of Keys in DBMS

 1 year ago
source link: https://www.geeksforgeeks.org/videos/types-of-keys-in-dbms/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Types of Keys in DBMS

Types of Keys in DBMS
Hello everyone. So in today's class I'm going to talk
Video Player is loading.
Loaded: 0.00%
00:00
Remaining Time -18:41

A key is an attribute or a set of attributes in a relation that identifies a tuple (a record) in a relation. In this video, we will see different types of keys in DBMS. Basically, the keys are defined in a table to access or sequence the stored data quickly and smoothly. They are also used to create states between different tables.

1) Super Key: Super Key is an attribute (or set of attributes) that is used to uniquely identifies all attributes in a relation. All super keys cannot be candidate keys. In a relation, number of super keys are more than number of candidate keys.

2) Candidate Key: The minimal set of attributes that can uniquely identify a tuple in database is known as a candidate key.

3) Primary Key: There can be more than one candidate key in relation out of which one can be chosen as the primary key. For Example, Enrollment_number in a student database is a primary key.

4) Alternate Key: The candidate key other than the primary key is called an alternate key.

5) Foreign Key: If an attribute can only take the values which are present as values of some other attribute, it will be a foreign key to the attribute to which it refers.

The relation which is being referenced is called referenced relation and the corresponding attribute is called referenced attribute and the relation which refers to the referenced relation is called referencing relation and the corresponding attribute is called referencing attribute. The referenced attribute of the referenced relation should be the primary key to it.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK