MySQL + SQL · Lesson 1

Dbms Keys Explained

सभी Keys एक जगह

यह page DBMS की हर key type को एक साफ example के साथ summarize करता है।

हर Key Type

Keyएक-पंक्ति मतलब
Super keyकोई भी unique-पहचान column set
Candidate keyMinimal super key
Primary keyचुना गया मुख्य identifier (unique, not null)
Alternate keyजो candidate keys primary नहीं चुनीं
Foreign keyदूसरी table की primary key को refer करती है
Composite keyकई columns से बनी

School Example

students(roll_no PK, admission_no UNIQUE, name)
marks(roll_no FK, subject, score, PRIMARY KEY(roll_no, subject))
marks एक COMPOSITE primary key (roll_no + subject) use करती है और roll_no FOREIGN key है।

सारांश

  • Keys: super, candidate, primary, alternate, foreign, composite।
  • Composite keys columns जोड़ती हैं; foreign keys tables link करती हैं।
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।