Advertisements
Advertisements
Question
What is the importance of primary key in a table? Explain with suitable example.
Explain
Advertisements
Solution
Importance of a primary key
- It uniquely identifies every row in a table.
- It prevents duplicate values and maintains data integrity.
- It does not allow
NULLvalues. - It helps establish relationships between tables.
- It makes searching and referencing records easier.
Example: In a Student table, AdNo can be the primary key because every student has a unique admission number. Thus, the record with AdNo = 101 can be identified without confusion.
shaalaa.com
Is there an error in this question or solution?
