हिंदी

What is the importance of primary key in a table? Explain with suitable example.

Advertisements
Advertisements

प्रश्न

What is the importance of primary key in a table? Explain with suitable example.

स्पष्ट कीजिए
Advertisements

उत्तर

Importance of a primary key

  1. It uniquely identifies every row in a table.
  2. It prevents duplicate values and maintains data integrity.
  3. It does not allow NULL values.
  4. It helps establish relationships between tables.
  5. 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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 9: Databases Concepts and SQL - EXERCISE [पृष्ठ १७३]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
अध्याय 9 Databases Concepts and SQL
EXERCISE | Q 14. | पृष्ठ १७३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×