10th ITLibre Office BaseVocational Education

Key and its important types in DBMS

Key and it’s types in DBMS

Key –

Keys का उपयोग Tables से डेटा के किसी भी record या row को uniquely पहचानने के लिए किया जाता है। इसका उपयोग Tables के बीच संबंधों को स्थापित करने और पहचानने के लिए भी किया जाता है।

उदाहरण के लिए: Student table में, Roll No. का उपयोग एक key के रूप में किया जाता है क्योंकि यह प्रत्येक छात्र के लिए unique है। Employee table में, पासपोर्ट नंबर, लाइसेंस नंबर keys हैं क्योंकि वे प्रत्येक व्यक्ति के लिए unique हैं।




 

Types of Key in DBMS

  • PRIMARY KEY
  • FOREIGN KEY
  • CANDIDATE KEY
  • ALTERNATE KEY

PRIMARY KEY

किसी relational table की primary key टेबल के प्रत्येक record को uniquely identify करती है।

1. Primary Key अद्वितीय(unique) होती है।
2. किसी भी टेबल में केवल एक ही primary key हो सकती है।
3. ये single या multi column हो सकती है, multi column primary key को हम composite primary key कहते है।
4. composite primary key में अधिकतम 16 column हो सकते है।
5. यह null values को contain नही करती है।

FOREIGN KEY

  1. जब किसी एक primary key को किसी दूसरे टेबल में प्राइमरी key के रूप में प्रयोग करते है तो उसे foreign key कहते हैं।
  2. Foreign key data में integrity को maintain करने के लिए method उपलब्ध कराता है।
  3. रिलेशनल डेटाबेस टेबल में एक foreign key columns का एक समूह होता है जो कि दो tables में data के मध्य link उपलब्ध कराता है।
  4. कहीं कहीं पर foreign key को referencing key भी कहा जाता है।

CANDIDATE KEY

  1. एक Candidate एक attribute या attributes का सेट है जो uniquely एक tuple की पहचान कर सकती है।
  2. Primary key को छोड़कर शेष attributes को एक candidate key के रूप में माना जाता है।
  3. Candidate key primary key के समान strong होती हैं।

ALTERNATE KEY

एक टेबल में एक से अधिक Candidate Key रहते हैं। उन Candidate Key मैं से बस एक ही को Primary key की तरह इस्तेमाल किया जाता है और बाकी जो key बचे रहते हैं उन्हें Alternate Key कहा जाता है।

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.