Candidate key In DBMS In Hindi – जानें हिन्दी में

Candidate key ek relational database design concept hai, jo ek table mein har ek row (record) ko uniquely identify karne ke liye use hota hai. Candidate key ko “unique key” bhi kaha jata hai. Har table mein ek hi primary key hoti hai, lekin ek table mein do ya do se zyada columns hote hain jo unique values contain karte hain, aur inhe candidate keys kaha jata hai. Primary key ko select karne ke liye inme se kisi ek ko choose kiya ja sakta hai.

Candidate key In DBMS In Hindi – जानें हिन्दी में:-

Yeh kuch important points hain jo candidate key ke baare mein samjha sakte hain:

  1. Uniqueness:
    • Candidate key ka mukhya uddeshya yeh hota hai ki har ek row ko uniquely identify kare. Iska matlab hai ki har row mein candidate key ki values unique honi chahiye.
  2. Minimality:
    • Candidate key ki values ko minimize kiya jata hai, yani ki usme kam se kam columns ka combination use hota hai jo ek row ko uniquely identify kar sake.
  3. Selection of Primary Key:
    • Ek table mein se ek candidate key ko primary key banaya ja sakta hai. Primary key selected hone par baki ke candidate keys ko unique constraint ke roop mein enforce kiya jata hai.
  4. Example:
    • Maan lijiye ek “Students” table hai jisme har student ko uniquely identify karne ke liye “Roll Number” aur “Email Address” dono use ho rahe hain. To dono hi columns candidate keys hote hain. Lekin, agar hum Roll Number ko primary key choose karte hain, to Email Address candidate key ke roop mein bana rahegi.
  5. Flexibility:
    • Candidate key choose karne ka ek fayda yeh hai ki future mein agar primary key mein koi changes karni padti hai, to doosre candidate key ko primary key banaya ja sakta hai.

In essence, candidate key ek table ke data ko uniquely identify karne ka ek potential way provide karta hai, aur isse primary key ka selection process me flexibility milti hai.

Example of Candidate Key In DBMS In Hindi

Let’s consider an example of a “Students” table in a relational database. In this table, we want to uniquely identify each student. Two possible candidate keys for this table could be “Student ID” and “Social Security Number (SSN).” Both of these columns have the potential to uniquely identify each student.

Here’s a simplified representation of the “Students” table:

Student IDNameSocial Security Number… (other columns)
101John Smith123-45-6789
102Jane Doe987-65-4321
103Bob Johnson234-56-7890
Example of Candidate Key In DBMS In Hindi

In this example:

  1. Student ID:
    • The “Student ID” column could be a candidate key because each student is assigned a unique identification number.
  2. Social Security Number (SSN):
    • The “Social Security Number” column could also be a candidate key because, ideally, each person has a unique SSN.

Both “Student ID” and “Social Security Number” satisfy the uniqueness criterion for being a candidate key. However, let’s say we decide to make “Student ID” the primary key of the “Students” table. In this case, “Social Security Number” remains a candidate key, and we enforce a unique constraint on it to maintain its uniqueness.

So, in summary, “Student ID” is chosen as the primary key, and “Social Security Number” becomes a candidate key in the “Students” table.

Advantages of Candidate key In DBMS In Hindi – जानें हिन्दी में:-

  1. Khaas pehchaan: Candidate keys yeh ensure karte hain ki har record ko uniquely identify kiya ja sake. Yani, do records mein kabhi bhi wahi values candidate key ke attributes mein nahi hongi. Isse data ki integrity bani rahti hai aur duplicate entries hone se bachta hai.
  2. Data ki Puri Suraksha: Candidate keys ka istemaal karke data ki accuracy aur consistency maintain hoti hai. Har record uniquely identify ho sakta hai, isse duplicate records ya galat associations hone ki chances kam ho jati hain.
  3. Tez Searches: Jab aap kisi specific record ko find karte hain, to candidate key hone se database system ko jaldi se required information mil jaati hai. Isse queries aur retrieval operations ka performance behtar hota hai.
  4. Join Operations: Candidate keys ko primary aur foreign keys ke through use karke different tables ke beech relationships establish ki ja sakti hain. Yeh join operations ko asaan banati hai aur related information ko link karna simplifies hota hai.
  5. Entity Integrity ka Palan: Candidate keys entity integrity ko maintain karte hain, yani har record ek unique entity ko represent karta hai. Isse database mein inconsistencies ya anomalies hone se bachaya ja sakta hai.
  6. Database Design mein Saralata: Database design mein candidate keys ko identify karke aap database ka overall structure simplify kar sakte hain. Yeh clarity banata hai aur developers aur administrators ko database ko samajhne aur uske saath kaam karne mein madad karta hai.

Sum up karte hue, candidate keys database mein data ki accuracy, integrity, aur efficiency ko ensure karne mein important role play karte hain. Yeh record ki uniqueness ko maintain karte hain, effective searching aur retrieval ko facilitate karte hain, aur overall database design ko robust banate hain.

Disadvantages of Candidate key In DBMS In Hindi – जानें हिन्दी में:-

  1. Complexity in selection : Sahi candidate key ko chunna mushkil ho sakta hai. Kabhi-kabhi ye clear nahi hota ki kaunsa combination of attributes candidate key ke roop mein kaam karega. Ye decision database ka design aur efficiency prabhavit kar sakta hai.
  2. Space consumption: Candidate keys, khaaskar agar ye multiple attributes ko involve karte hain, adhik storage space ka upayog kar sakte hain. Har record ko in key attributes ke liye values store karna padta hai, aur agar key mein kai attributes hote hain to storage requirement badh jaati hai.
  3. Performance Impact: Zyada candidate keys, khaaskar complex wale, kuch database operations ki performance ko dheere kar sakte hain. Indexing aur searching in keys ke saath adhik resourcess ka upayog karti hai.
  4. Maintenance Overhead: Agar candidate key mein koi changes karni padti hai, to yeh complexity introduce kar sakti hai aur dependent tables aur queries ko update karne ki zarurat pad sakti hai. Maintenance ka ye bojh database management ko mushkil bana sakta hai.
  5. Understanding and Documentation:Bohot saare candidate keys wale database ko samajhna aur document karna mushkil ho sakta hai. Ye complexity developers, administrators, aur database structure ko samajhne wale logon ke liye mushkil bana sakti hai.
  6. Inflexibility in Updates: Agar candidate key ko update karna padta hai, khaaskar agar ye primary key hai, to ise manage karna mushkil ho sakta hai, kyun ki ye doosre tables ke foreign keys se juda hua hota hai. Is tarah ke keys ko update karna dhyan aur coordination ki zarurat hoti hai.

Features of Candidate key In DBMS In Hindi – जानें हिन्दी में:-

  1. Uniकृपयाता (Uniqueness): Candidate key ka yeh sabse important feature hai. Har combination of values jo is key mein hota hai, woh table ke saare records mein unique hona chahiye. Yeh duplicate entries ko rokne mein madad karta hai.
  2. Ghairghatayi आदमी (Irreducibility): Har candidate key irreducible honi chahiye, matlab is key ke koi bhi subset ko remove karne se uniqueness ka kho jana nahi chahiye.
  3. न्यूनतमता (Minimality): Candidate key minimum hona important hai, matlab isme se koi bhi chota subset unique identifier ka kaam nahi kar sakta. Har attribute is key ke liye zaroori hai uniqueness ke liye.
  4. स्थिरता (Consistency): Candidate key ke values consistent honi chahiye, yani unmein stability aur frequent changes na ho. Isse record ki identification mein stability aur reliability bani rahti hai.
  5. लागूयिता (Applicability): Candidate key ka use specific domain ya context mein records ko uniquely identify karne ke liye hona chahiye. Yeh real-world scenario ko model karne wale database ke liye applicable hona chahiye.
  6. नॉन-नल (Non-Null Values): Har attribute candidate key mein non-null (non-empty) hona chahiye. Null values uniqueness ke saath problems create kar sakte hain, isliye candidate key non-null attributes se bani hoti hai.
  7. स्थिरता (Stability): Candidate key mein changes kam hone chahiye aur agar hote hain to uske saath judi hui doosri tables par bhi dhyan dena chahiye, especially foreign key relationships ke through
    .
  8. सहजता (Ease of Use): Yeh technically zaroori nahi hai, lekin ek acchi candidate key aksar user-friendly hoti hai. Yani ki developers aur database administrators ke liye samajhne mein aur use karne mein aasan hoti hai.

In features ko samajh kar candidate keys ko sahi tarah se choose aur design karna aasan ho jata hai, jisse woh records ko database mein uniquely identify kar sake.

Leave a Comment