MySQL + SQL · Lesson 1
Dbms Keys Explained
सभी Keys एक जगह
यह page DBMS की हर key type को एक साफ example के साथ summarize करता है।
हर Key Type
| Key | एक-पंक्ति मतलब |
|---|---|
| Super key | कोई भी unique-पहचान column set |
| Candidate key | Minimal 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 करती हैं।