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 Number | First Name | Surname |
---|---|---|
NO-32 | Sandeep | Sethi |
SO-09 | Subhash | Kumar |
SO-11 | Anand | Swami |
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