KnowledgeBoat Logo

Computer Science

What is the importance of a Primary Key in a table ? Explain with a suitable example.

Relational Database

1 Like

Answer

The importance of a Primary Key in a table lies in its ability to uniquely identify tuples (or rows) within the table.

Salesman NumberFirst NameSurname
NO-32SandeepSethi
SO-09SubhashKumar
SO-11AnandSwami

In this table, the "Salesman Number" column can be designated as the primary key. Each "Salesman Number" value uniquely identifies a salesperson in the table, and no two salespersons can have the same number. Additionally, the "Salesman Number" column would not accept null values, ensuring that every salesperson has a valid identifier.

Answered By

3 Likes


Related Questions