In a relational database, what is a primary key?
2024
In a relational database, what is a primary key?
- A.
A key used to uniquely identify each record in a table
- B.
A key used to establish relationships between tables
- C.
A key used to sort records in a table
- D.
More than one of the above
- E.
None of the above
Attempted by 2502 students.
Show answer & explanation
Correct answer: A
A primary key is a column or set of columns in a database table that uniquely identifies each row in that table. It ensures that no two rows have the same value for the primary key, and it cannot contain NULL values.
Key properties of a primary key:
Uniqueness: Each value in the primary key column must be unique.
Non-null: The primary key cannot have NULL values.
Stability: Primary key values should not change frequently.
In relational databases, primary keys are essential for maintaining data integrity and enabling relationships between tables.
हिन्दी उत्तर:
रिलेशनल डेटाबेस में प्राइमरी की एक या एक से अधिक कॉलम्स का सेट होता है जो टेबल में प्रत्येक पंक्ति को अद्वितीय रूप से पहचानता है। यह सुनिश्चित करता है कि किसी भी दो पंक्तियों के प्राइमरी की कॉलम में समान मान नहीं होता है, और यह NULL मान नहीं रख सकता है।
प्राइमरी की के मुख्य गुण:
अद्वितीयता: प्राइमरी की कॉलम में प्रत्येक मान अद्वितीय होना चाहिए।
गैर-शून्य: प्राइमरी की में NULL मान नहीं हो सकता है।
स्थिरता: प्राइमरी की मान अक्सर नहीं बदलना चाहिए।
रिलेशनल डेटाबेस में, प्राइमरी की डेटा अखंडता बनाए रखने और टेबलों के बीच संबंध स्थापित करने के लिए आवश्यक होती है।