Mapping Constraints क्यों जरूरी हैं?
जब दो entities के बीच relationship बनाया जाता है, तो database को यह पता होना चाहिए कि:
- एक entity कितने objects से जुड़ी है?
- किस entity पर कितने records depend हैं?
- relation one-to-one है या one-to-many?
इन्हीं नियमों को Mapping Constraints define करते हैं, जिससे database सही और logical structure में बनता है।
Mapping Constraints के प्रकार (Types of Mapping Constraints)
Mapping Constraints में 4 प्रकार की cardinalities होती हैं:
| Type | Relation |
|---|---|
| One-to-One (1:1) | एक entity केवल एक दूसरी entity से connect |
| One-to-Many (1:M) | एक entity कई entities से connect |
| Many-to-One (M:1) | कई entities एक entity से connect |
| Many-to-Many (M:N) | कई entities कई entities से connect |
अब इन्हें आसान examples सहित समझते हैं:
1) One-to-One Relationship (1:1)
इसमें एक entity सिर्फ एक ही दूसरे entity से संबंध रख सकती है।

Example:
एक व्यक्ति (Husband) सिर्फ एक पत्नी (Wife) से शादी कर सकता है, और पत्नी भी एक ही पति से शादी कर सकती है।
इसलिए यह संबंध One-to-One कहलाता है।
2) One-to-Many Relationship (1:M)
इसमें एक entity कई entities से संबंध रख सकती है, लेकिन दूसरी entity केवल एक से ही जुड़ी होती है।

Example:
एक College में कई Students पढ़ सकते हैं,
लेकिन एक Student केवल एक College में दाखिला लेता है।
इसलिए यह संबंध One-to-Many है।
3) Many-to-One Relationship (M:1)
इसमें कई entities किसी एक entity से जुड़ी होती हैं।

Example:
कई Employees एक Manager को report कर सकते हैं,
लेकिन एक Manager को कई Employees संभालते हैं।
इसलिए यह संबंध Many-to-One कहलाता है।
4) Many-to-Many Relationship (M:N)
इसमें दोनों entity-set एक-दूसरे से कई relations रख सकते हैं।

Example:
कई Students कई Subjects पढ़ सकते हैं।
और कई Subjects कई Students के लिए उपलब्ध होते हैं।
यह संबंध Many-to-Many है।
इन्हें भी पढ़े –
- DBMS क्या है DBMS के प्रकार और कार्य की पूरी जानकारी | DBMS In Hindi
- डेटाबेस यूजर्स क्या है?
- डेटा इंडिपेंडेंस क्या है
- DBMS के लाभ
- Characteristics Of DBMS In Hindi
- डेटा मॉडल क्या है?
- डेटाबेस स्कीमा क्या है
- इंस्टैंस क्या है
- डेटाबेस इंटरफ़ेस क्या है
- डेटाबेस लैंग्वेज क्या है
- Classification of DBMS in Hindi
- Entity Set in DBMS
- DBMS Architecture in Hindi
- Types of Data Models in Hindi
- Attributes in DBMS in Hindi
- Entity Set in DBMS (Hindi)
- Entity Types in DBMS (Hindi)
- Types of Attributes in DBMS
- ER Model in DBMS (E-R मॉडल) क्या है?
- Entities के बीच संबंध
- Domain in DBMS
- Tuples in DBMS
- SQL में Joins क्या हैं?
- Primary Key in DBMS
- DBMS Keys in Hindi
- DBMS Data Integrity in Hindi
- Relational Algebra in DBMS
- Normalization in DBMS क्या है?
- BCNF (Boyce-Codd Normal Form) in DBMS
- Functional Dependency in DBMS
- Non-Loss Decomposition in DBMS
- SQL Data Types in Hindi
- Create Table in SQL in Hindi
- SQL DROP TABLE और ALTER TABLE in Hindi
- SQL Indexes in Hindi
- SDLC in Hindi
- DBLC in Hindi
- SQL Views in Hindi
- PL/SQL PROCEDURES in hindi
- Database Normalization in Hindi
- Domain Key Normal Form in Hindi
- SQL Objects in Hindi
- Aggregation, Generalization, Specialization and Association in Hindi
- Data Dictionary क्या है?
- डेटा वेयरहाउसिंग क्या है?
- डाटा माइनिंग क्या है?
- File Organization in Hindi DBMS
- Relational Model in Hindi – रिलेशनल मॉडल क्या है?
- RDBMS Applications in Hindi
- MySQL क्या है?
- Parallel Database in Hindi
- Database Costs and Risk Factors in Hindi
- डिस्ट्रिब्यूटेड डेटाबेस क्या होता है?
- Operational Data vs Decision Support Data in Hindi
निष्कर्ष –
| Relationship | Explanation |
|---|---|
| 1:1 | एक से एक |
| 1:M | एक से कई |
| M:1 | कई से एक |
| M:N | कई से कई |
Mapping Constraints database को meaningful, efficient और logically correct बनाने में मदद करते हैं।