Which of the following are characteristics of a Primary Key?
Answer: D) All of the above
A Primary Key is a field or combination of fields used to uniquely identify each record in a database table. It has the following characteristics:
A. Must contain unique values – Correct
Every record must have a different Primary Key value. Duplicate values are not allowed.
Example:
In a Student Table:
STU001 – Ram
STU002 – Hari
STU003 – Sita
Here, each Student ID is unique. A Primary Key can contain numbers or text values.
B. Cannot contain NULL values – Correct
A Primary Key cannot contain NULL or empty values. Every record must have a valid value in its Primary Key field.
For example, every student record must have a Student ID.
C. Can be used to establish relationships with Foreign Keys – Correct
A Primary Key in one table can be referenced by a Foreign Key in another table to establish a relationship between the tables.
For example:
- Student Table: Student ID (Primary Key)
- Marks Table: Student ID (Foreign Key)
This relationship connects each student's information with their marks.
Therefore, all three statements are correct. The correct answer is D. All of the above.
Primary Key (प्राइमरी की) भनेको Database Table मा प्रत्येक Record (रेकर्ड) लाई छुट्टाछुट्टै पहिचान गर्न प्रयोग गरिने Field वा Fields को समूह हो। यसका मुख्य विशेषताहरू निम्न छन्:
A. Must contain unique values – सही
Primary Key को प्रत्येक Record मा फरक-फरक Value हुनुपर्छ। एउटै Value दोहोरिनु हुँदैन।
उदाहरण:
STU001 – राम
STU002 – हरि
STU003 – सीता
यहाँ प्रत्येक विद्यार्थीको ID फरक छ। Primary Key मा Number वा Text दुवै प्रकारका Value राख्न सकिन्छ।
B. Cannot contain NULL values – सही
Primary Key मा NULL अर्थात् कुनै Value नभएको अवस्था स्वीकार्य हुँदैन। प्रत्येक Record मा अनिवार्य रूपमा एउटा Value हुनुपर्छ।
उदाहरणका लागि, विद्यार्थीको प्रत्येक Record मा Student ID हुनैपर्छ।
C. Can be used to establish relationships with Foreign Keys – सही
एउटा Table को Primary Key लाई अर्को Table को Foreign Key मार्फत जोडेर दुईवटा Table बीच सम्बन्ध (Relationship) स्थापना गर्न सकिन्छ।
उदाहरण:
- Student Table: Student ID (Primary Key)
- Marks Table: Student ID (Foreign Key)
यसरी Student ID को माध्यमबाट विद्यार्थीको विवरण र उसको प्राप्ताङ्कलाई एकआपसमा जोड्न सकिन्छ।
त्यसैले A, B र C तीनवटै कथन सही भएकाले सही उत्तर D. All of the above हो।
Exam Tip:
- Primary Key: प्रत्येक Record लाई छुट्टाछुट्टै पहिचान गर्छ।
- Unique Value: दोहोरिन पाउँदैन।
- Not Null: खाली राख्न पाइँदैन।
- Foreign Key: अर्को Table को Primary Key लाई Reference गर्छ।
Primary Key मा Number मात्र होइन, Text पनि प्रयोग गर्न सकिन्छ।

