Relational Database Design Algorithms in Hindi
DIPLOMA_CSE / DBMS
Relational Database Design Algorithms in Hindi
Synthesis Approach for 3NF in Hindi
3NF (Third Normal Form) के लिए Synthesis Approach एक तकनीक है जो relational database के normalization के दौरान उपयोग की जाती है। इसका उद्देश्य ऐसा schema बनाना है जो data redundancy को कम करे और data integrity को बनाए रखे। इस प्रक्रिया में, हम यह सुनिश्चित करते हैं कि database में सभी functional dependencies ठीक से satisfied हों और कोई unnecessary duplicate data ना हो।
Introduction to Synthesis Approach
Synthesis Approach के अंतर्गत, हम relational schema को 3NF में लाने के लिए step-by-step approach follow करते हैं। इस प्रक्रिया में हमें functional dependencies और candidate keys को समझना जरूरी होता है। इसे तीन मुख्य चरणों में बांटा जा सकता है।
- पहला चरण: Functional dependencies की पहचान करना और उनकी सूची तैयार करना।
- दूसरा चरण: उन dependencies को सही तरीके से organize करना ताकि वे 3NF की शर्तों को पूरा करें।
- तीसरा चरण: Relations को suitable sub-relations में विभाजित करना।
Step-by-Step Process for Synthesis Approach
इस प्रक्रिया को समझने के लिए हम इसे तीन मुख्य steps में divide कर सकते हैं:
- Step 1: सबसे पहले, सभी functional dependencies को list किया जाता है। इन dependencies को अच्छे से समझना जरूरी है क्योंकि ये relational schema को design करने में मदद करती हैं।
- Step 2: इसके बाद, हम यह सुनिश्चित करते हैं कि schema में सभी functional dependencies 3NF को satisfy करती हैं। इसका मतलब है कि किसी भी non-prime attribute को कोई भी candidate key पूरी तरह से determine करता है।
- Step 3: आखिरी चरण में, अगर कोई relation 3NF को satisfy नहीं करता तो उसे sub-relations में split किया जाता है। इस तरह से, data redundancy और anomalies को minimize किया जाता है।
Functional Dependencies in Synthesis Approach
Functional dependencies को समझना Synthesis Approach के लिए बहुत महत्वपूर्ण है। Functional dependency तब होती है जब एक attribute के values दूसरे attribute के values पर निर्भर होते हैं। इसका मतलब यह है कि एक attribute के basis पर हम दूसरे attribute का value predict कर सकते हैं।
- Functional dependency के दौरान, हमें यह देखना होता है कि कौन से attributes primary key हैं और कौन से non-prime attributes हैं।
- हम यह भी जांचते हैं कि कोई non-prime attribute किसी candidate key से पूरी तरह determine हो रहा है या नहीं।
- यदि ऐसा नहीं हो रहा, तो हमें relation को और sub-relations में divide करना पड़ता है।
Example of Synthesis Approach for 3NF
मान लीजिए कि हमारे पास एक relation है: Employee (Employee_ID, Employee_Name, Department, Department_Location, Manager)
- Functional dependencies:
- Employee_ID → Employee_Name, Department, Department_Location, Manager
- Department → Department_Location, Manager
- इस relation को 3NF में लाने के लिए हमें इसे दो sub-relations में split करना होगा:
- Employee (Employee_ID, Employee_Name, Department)
- Department (Department, Department_Location, Manager)
- इस तरह, हमने redundancy को कम किया और दोनों relations 3NF में आ गए।
Decomposition into BCNF in Hindi
BCNF (Boyce-Codd Normal Form) को relational database design में 3NF से भी ज्यादा strict normal form माना जाता है। BCNF का उद्देश्य यह है कि किसी भी relation में सभी functional dependencies को candidate keys के द्वारा fully determine किया जाए। इस प्रक्रिया में, हम relations को इस तरह से break करते हैं ताकि data redundancy कम हो और data anomalies eliminate हो जाएं।
Introduction to BCNF
BCNF एक विशेष प्रकार का normal form है, जो 3NF से ज्यादा strict होता है। BCNF में हर functional dependency का determinant एक candidate key होना चाहिए। यदि कोई भी functional dependency इस rule का पालन नहीं करती, तो relation BCNF में नहीं होता।
- 3NF में functional dependency की शर्तें पूरी होनी चाहिए, जबकि BCNF में हर dependency का determinant एक candidate key होना चाहिए।
- इसमें हर relation में redundant data और anomalies को कम करने के लिए उसे sub-relations में विभाजित किया जाता है।
- BCNF का उद्देश्य data redundancy को minimize करना और data integrity को maintain करना है।
Conditions for BCNF
BCNF में decomposition करने से पहले, हमें यह सुनिश्चित करना होता है कि सभी functional dependencies के determinants candidate keys हों। यदि कोई dependency इस शर्त को नहीं पूरा करती, तो हमें उस relation को decompose करना पड़ता है।
- यदि कोई functional dependency A → B है, तो A को candidate key होना चाहिए।
- अगर किसी dependency में A candidate key नहीं है, तो relation BCNF के rules को follow नहीं करता।
- इसलिए, BCNF में decomposition के दौरान हर dependency के लिए इस condition को check किया जाता है।
Decomposition Process into BCNF
BCNF में decomposition एक step-by-step process है जिसमें हर relation को छोटे relations में तोड़ा जाता है। इस प्रक्रिया के दौरान हम यह ensure करते हैं कि हर relation BCNF के rules को follow करता हो।
- Step 1: सबसे पहले, हम relation को analyze करते हैं और उसकी functional dependencies की पहचान करते हैं।
- Step 2: फिर, हम check करते हैं कि क्या कोई dependency candidate key से determined नहीं है।
- Step 3: यदि dependency valid नहीं है, तो हम relation को sub-relations में decompose करते हैं और ensure करते हैं कि सभी sub-relations BCNF में हों।
Example of Decomposition into BCNF
मान लीजिए हमारे पास एक relation है: Student (Student_ID, Course, Instructor)
- Functional dependencies:
- Student_ID → Course, Instructor
- Course → Instructor
- यह relation BCNF में नहीं है क्योंकि Course → Instructor dependency में Course candidate key नहीं है।
- इसलिए, हम relation को दो sub-relations में decompose करेंगे:
- Student (Student_ID, Course)
- Course_Instructor (Course, Instructor)
- अब, दोनों sub-relations BCNF के rules को follow करते हैं।
Algorithms for Multivalued Dependencies in Hindi
Multivalued Dependency (MVD) relational databases में एक प्रकार की dependency होती है, जिसमें एक attribute set किसी दूसरे attribute set से संबंधित होता है। MVD का उपयोग database normalization के दौरान किया जाता है ताकि data redundancy को कम किया जा सके। यह सामान्यत: 4NF (Fourth Normal Form) के context में महत्वपूर्ण है, क्योंकि यह उस स्थिति को दर्शाता है जब relations में कोई भी multivalued dependency मौजूद होती है।
Introduction to Multivalued Dependencies
Multivalued Dependency (MVD) तब होती है जब एक attribute set दूसरे attribute set पर निर्भर होता है, और यह dependency relation के दो या दो से अधिक attributes के बीच होती है। इस dependency को यह सुनिश्चित करने के लिए इस्तेमाल किया जाता है कि relation में कोई unnecessary redundancy न हो।
- Multivalued dependencies तब exist करती हैं जब एक attribute से अन्य attributes का एक set associated होता है।
- यह अधिकतर तब होती है जब दो या दो से अधिक attributes के बीच कई values होती हैं।
- MVDs का मुख्य उद्देश्य data redundancy और anomalies को कम करना है।
Conditions for Multivalued Dependencies
Multivalued dependencies को सही तरीके से लागू करने के लिए कुछ शर्तें होती हैं। जब एक attribute set दूसरे attribute set के लिए multivalued dependency को satisfy करता है, तो relation को सही तरीके से design किया जा सकता है।
- Multivalued dependency (A →→ B) तब होती है जब attribute A के लिए attribute B की values exist करती हैं, और यह dependency relation के अंदर होती है।
- Multivalued dependency को correct तरीके से implement करने के लिए हमें यह सुनिश्चित करना होता है कि B में सभी values A के basis पर exist करती हों।
- यदि ऐसा नहीं होता, तो हमें relation को decompose करने की आवश्यकता होती है ताकि MVDs को सही तरीके से satisfy किया जा सके।
Algorithms for Dealing with Multivalued Dependencies
Multivalued dependencies से निपटने के लिए कुछ algorithms होते हैं जिनका उपयोग data को optimize करने और relations को normalize करने में किया जाता है। यह algorithms relational schema को चार मुख्य steps में decompose करने का काम करते हैं।
- Step 1: सबसे पहले, हमें relation में मौजूद सभी multivalued dependencies की पहचान करनी होती है।
- Step 2: फिर, हम यह सुनिश्चित करते हैं कि relation में सभी dependencies पूरी तरह से satisfied हों।
- Step 3: यदि कोई dependency सही नहीं है, तो हम relation को sub-relations में decompose करते हैं।
- Step 4: अंत में, हम यह जांचते हैं कि क्या सभी sub-relations multivalued dependency को satisfy कर रहे हैं या नहीं।
Example of Multivalued Dependency
मान लीजिए हमारे पास एक relation है: Employee (Employee_ID, Skill, Language)
- Multivalued dependency:
- Employee_ID →→ Skill, Language
- यह dependency बताती है कि Employee_ID attribute के लिए Skill और Language attributes के multiple values exist करती हैं।
- इस dependency को सही तरीके से manage करने के लिए हमें relation को two sub-relations में divide करना पड़ेगा:
- Employee_Skills (Employee_ID, Skill)
- Employee_Languages (Employee_ID, Language)
- अब, दोनों sub-relations multivalued dependency को satisfy करते हैं और data redundancy कम हो जाता है।