CBSE Class 11 & 12 Computer Science and Informatics Practices Python Materials, Video Lecture

DBMS Table Keys

DBMS Table Keys

If you are learning about the database, so most welcome to my article. By reading this article today, you will be able to get information about the Keys Of DBMS. So today we are going to discuss What is keys in DBMS and DBMS Keys Types. Here we will learn the basics of Keys. This is a very important topic of CBSE class 11th, related questions are asked in the exam always.

So, Friends, we know about the key in detail.

What Is Key?

Friends, as you know, a key means a key. The way a key is used to open any lock or key is required. In the same way, we need a key to extract any data in the database table. Suppose I made a table and you must have known that a table has both rows and columns. So friends, if you want a particular data from the table, how will you tell what data is needed, then we use the key.  Key We speak those attributes, when you tell the value, we can find a row using the same value. 
  • Keys in DBMS is a set of attributes that help you to identify a row(tuple) in a relation(table).
  • The Key is also helpful for finding a unique record or particular row from the table. 
  • The Key is a Unique Identifier. They allow you to find the relation between two tables.
Example – Aadhar Card, PAN Card, A/c No.

why Do we Need Key?

  • Any colleges/schools or companies have a large level database that contains a lot of tables,  table could contain thousands of records or rows, so Keys help you to identify any row of data in a table. 
  • Keys generate the relation between tables and establish the connection.

How Many Types Are DBMS Keys?

There are the following 6 keys in DBMS-
  1. Candidate Key
  2. Primary Key
  3. Alternate Key
  4. Super Key
  5. Foreign Key
  6. Composite Key 

What Is Candidate Keys? 

  • A set of columns can be called a candidate key if they identify each row of a table uniquely.
  • In a table, there may be more than one column that can have unique values.
  • A table can have multiple candidate keys.
  • A candidate key column cannot have NULL values.

candidate key

What Is Primary Key?

  • The Primary key should be selected from the candidate keys. 
  • Primary keys must contain unique values. 
  • A table cannot have more than one primary key.
  • A primary key column cannot have NULL values.

primary key

What Is Alternate Key?

  • A table can have multiple candidate keys. Among these candidate keys, only one key gets selected as the primary key the remaining keys are known as alternative or secondary keys.
  •  Alternate Keys have all the properties to work as a primary key.

alternate key

What Is Foreign Key?

  • A foreign key is used to create a connection between the tables.
  • A foreign key in one table used to point to the primary key in another table.

foreign key

What Is Composite Key?
  • A composite key is the combination of at least one key attribute and one non-key attribute.
  • In Composite Key, we will identify a particular row using more than one column.

composite key

I think you must have understood this post. you can see this video. Thank You

No comments:

Post a Comment