Feedback Form

Steps in EER to Relational Mapping in Hindi

Steps in EER to Relational Mapping

Table of Contents

Steps in EER to Relational Mapping in Hindi

इस ब्लॉग में हम Steps in EER to Relational Mapping in Hindi को बहुत सरल भाषा में समझेंगे। यह Database Design का एक महत्वपूर्ण हिस्सा है जहाँ हम Enhanced Entity Relationship (EER) Model को Relational Model में convert करना सीखते हैं। यह प्रक्रिया Database Management System (DBMS) में data को logically represent करने के लिए बहुत उपयोगी है।

जब हम किसी real-world system का model बनाते हैं तो सबसे पहले हम उसे EER Diagram के रूप में design करते हैं। लेकिन DBMS को implement करने के लिए हमें उसे relational tables में बदलना पड़ता है। इसी प्रक्रिया को हम EER to Relational Mapping कहते हैं। नीचे हर step को विस्तार से बताया गया है ताकि concept पूरी तरह से clear हो सके।

1. Map Regular Entity Types (साधारण Entity को Relation में बदलना)

सबसे पहले हम सभी simple या regular entities को relational tables में convert करते हैं। हर entity के लिए एक अलग relation (table) बनाया जाता है। Entity के attributes को उस table के columns के रूप में रखा जाता है।

  • हर entity का key attribute primary key बनता है।
  • अगर entity के पास multiple attributes हैं, तो सभी को column के रूप में रखा जाता है।

उदाहरण: यदि हमारे पास एक entity है Student(Student_ID, Name, Age), तो इसे relational form में वैसे ही रखा जाएगा।

2. Map Weak Entity Types (कमज़ोर Entity को Relation में बदलना)

Weak entity अपनी पहचान किसी strong entity पर आधारित रखती है। इसे mapping करते समय दो बातें महत्वपूर्ण हैं:

  • Weak entity को भी एक relation के रूप में दर्शाया जाता है।
  • इस relation में strong entity की primary key को foreign key के रूप में add किया जाता है।

उदाहरण: Dependent(Dependent_Name, Employee_ID, Age) जहाँ Employee_ID एक foreign key है जो Employee entity से जुड़ी है।

3. Map Binary 1:1 Relationships (एक से एक संबंध को Relation में बदलना)

जब दो entities के बीच One-to-One relationship होता है, तो दोनों में से किसी एक entity की primary key को दूसरी में foreign key के रूप में जोड़ सकते हैं।

  • यह तय करना होता है कि foreign key किस table में add की जाए।
  • सामान्यत: उस entity में foreign key रखी जाती है जो कम dependent होती है।

4. Map Binary 1:N Relationships (एक से कई संबंध को Relation में बदलना)

यह सबसे सामान्य प्रकार का relationship होता है। इस mapping में ‘One’ side की primary key को ‘Many’ side की foreign key बनाया जाता है।

  • ‘Many’ entity में एक foreign key column add किया जाता है।
  • Foreign key उस entity की primary key को reference करती है जो ‘One’ side पर है।

5. Map M:N Relationships (कई से कई संबंध को Relation में बदलना)

जब दो entities के बीच many-to-many संबंध होता है तो उसे represent करने के लिए एक नया relation (junction table) बनाया जाता है।

  • यह नया table दोनों entities की primary keys को foreign keys के रूप में रखता है।
  • अगर relationship के खुद के attributes हों, तो उन्हें भी इसी table में रखा जाता है।
Entity 1 Entity 2 New Relation (M:N Mapping)
Student Course Enrollment(Student_ID, Course_ID, Date_Of_Join)

6. Map Multi-Valued Attributes (बहु-मूल्य Attributes को Relation में बदलना)

यदि किसी entity में multi-valued attribute है, तो उसके लिए एक नया relation बनाया जाता है ताकि redundancy से बचा जा सके।

  • नए relation में original entity की primary key और multi-valued attribute दोनों रखे जाते हैं।
  • दोनों columns को मिलाकर composite key बनाई जाती है।

7. Map Composite Attributes (समग्र Attributes को Relation में बदलना)

Composite attribute कई sub-attributes का combination होता है, जैसे Address = (City, State, Pincode)। ऐसे attributes को break करके simple attributes में बदल दिया जाता है।

  • Relation में केवल sub-attributes को columns क