Chapter :- 2 (Hindi)

Site: AssessmentKaro
Course: Database Management System
Book: Chapter :- 2 (Hindi)
Printed by: Guest user
Date: Saturday, 18 April 2026, 6:50 PM

Description

Bharatavani is a project with an ...Topic wise chapter (Hindi)

1. Relational Data Model

📖 Definition (परिभाषा)

  • English: The relational model is a way to store and manage data using tables. Each table is called a relation, and it looks like a grid of rows and columns.
  • Hindi: Relational model एक तरीका है जिसमें data tables में store और manage किया जाता है। हर table को relation कहते हैंऔर यह rows और columns वाली grid जैसा दिखता है।

👉 In other words (दूसरे शब्दों में):
A data model is a structured way to describe how data is stored, organized, related, and managed in a database.
Hindi: Data model 
एक structured तरीका है जिससे हम बताते हैं कि database में data कैसे store, organize, relate और manage होता है।

It defines (यह बताता है):

  • Data structure (tables, objects, attributes)
  • Relationships between data (data के बीच संबंध)
  • Constraints and rules (नियम और प्रतिबंध)

Examples (उदाहरण): Hierarchical model, Network model, Relational model, Object-oriented model, ER model.

📊 Key Components (मुख्य घटक)

  • Relation (रिलेशन): A table that holds data. Each relation has a name and contains rows and columns.
  • Attributes (एट्रिब्यूट्स): Column names in a table (जैसे Name, Age)
  • Tuples (ट्यूपल्स): Rows in a table, each row एक record होता है।
  • Domain (डोमेन): Valid values for an attribute (जैसे Age का domain 0 से 120 integers तक हो सकता है)।

🧠 Example (उदाहरण)

Students Table:

 

 

 

 

 

 

 

 

 

  • "Students" → Relation (टेबल का नाम)
  • "StudentID", "Name", "Age" → Attributes (कॉलम्स)
  • Each row → Tuple (रिकॉर्ड)
  • Domain of "Age" → Whole numbers (पूर्णांक)

 Advantages of Data Models (फायदे)

  1. Clear Understanding of Data (डेटा की स्पष्ट समझ)
    • Database का structure clear होता हैजिससे data समझना आसान होता है।
  2. Improves Communication (बेहतर संचार)
    • Designers, developers और users एक common framework से communicate कर सकते हैं।
  3. Ensures Data Consistency (डेटा की स्थिरता)
    • Rules और constraints define होते हैंजिससे data accurate और consistent रहता है।
  4. Simplifies Design (डिज़ाइन आसान बनाता है)
    • Database design में मदद करता है, relationships और data flow दिखाता है।
  5. Supports Better Performance (बेहतर प्रदर्शन)
  • अच्छा model queries को fast और storage को efficient बनाता है।

 Disadvantages of Data Models (नुकसान)

  1. Time-Consuming (समय लेने वाला)
    • अच्छा data model बनाने में analysis और planning ज़्यादा समय लेती है।
  2. Needs Skilled Designers (कुशल डिज़ाइनर चाहिए)
    • Knowledge और experience ज़रूरी हैवरना poor design बन सकता है।
  3. Rigid Structure (कठोर संरचना)
    • Model बनने के बाद उसे बदलना मुश्किल और costly होता है।
  4. Not Always Real-World Perfect (हमेशा वास्तविक दुनिया से मेल नहीं खाता)
    • Complex real-world situations model में perfectly fit नहीं होतीं।
  5. Additional Development Cost (अतिरिक्त लागत)
  • Detailed modeling project की initial cost बढ़ा देता है।

2. Types of Data Models

Types of Data Models (डेटा मॉडल के प्रकार)

1️ Hierarchical Data Model (हायरेरकिकल डेटा मॉडल)

Definition (परिभाषा):
Organizes data in a tree structure with parent–child (one-to-many) relationship.
Hindi: Data 
को tree structure में organize करता है जहाँ parent–child (एक से कई) संबंध होता है।

 Advantages (फायदे):

  • Simple और fast hierarchical data के लिए
  • High performance देता है
  • Structure easy to understand

 Disadvantages (नुकसान):

  • Many-to-many relationships represent नहीं कर सकता
  • Structure rigid होता है, modify करना मुश्किल
  • Access paths की knowledge ज़रूरी

2️ Network Data Model (नेटवर्क डेटा मॉडल)

Definition (परिभाषा):
Uses graph structure allowing many-to-many relationships.
Hindi: Graph structure use 
करता है जिससे many-to-many relationships possible होते हैं।

 Advantages (फायदे):

  • Complex relationships support करता है
  • Direct pointers से faster access
  • Hierarchical model से ज़्यादा flexible

 Disadvantages (नुकसान):

  • Design बहुत complex होता है
  • Users के लिए navigate करना मुश्किल
  • Implement होने के बाद modify करना कठिन

3️ Relational Data Model (रिलेशनल डेटा मॉडल)

Definition (परिभाषा):
Organizes data in tables (relations) using rows and columns.
Hindi: Data 
को tables (relations) में rows और columns के रूप में organize करता है।

 Advantages (फायदे):

  • Easy to use और समझने में आसान
  • SQL (powerful query language) support करता है
  • Strong data integrity और flexibility

 Disadvantages (नुकसान):

  • बहुत बड़े datasets पर hierarchical/network models से slow
  • Huge databases के लिए powerful hardware चाहिए
  • Joins performance reduce कर सकते हैं

4️ Object-Oriented Data Model (ऑब्जेक्ट-ओरिएंटेड डेटा मॉडल)

Definition (परिभाषा):
Stores data as objects similar to object-oriented programming.
Hindi: Data 
को objects के रूप में store करता हैजैसे object-oriented programming में होता है।

 Advantages (फायदे):

  • Complex data (images, videos, objects) handle कर सकता है
  • Inheritance से reusability
  • Multimedia और engineering applications के लिए अच्छा

 Disadvantages (नुकसान):

  • Design complex होता है
  • Relational models जितना widely used नहीं है
  • Existing relational databases के साथ integrate करना मुश्किल

5️ Entity–Relationship (ER) Model (एंटिटी–रिलेशनशिप मॉडल)

Definition (परिभाषा):
Uses ER diagrams with entities, attributes, and relationships to design databases.
Hindi: ER diagrams 
का use करता है जिसमें entities, attributes और relationships होते हैं database design के लिए।

 Advantages (फायदे):

  • Database design और visualization के लिए excellent
  • Easy to understand
  • Relationships और constraints identify करने में मदद करता है

 Disadvantages (नुकसान):

  • Physical implementation model नहीं है
  • Complex constraints handle करने में limited
  • Use करने से पहले relational model में convert करना पड़ता है

6️ Object-Relational Data Model (ऑब्जेक्ट-रिलेशनल डेटा मॉडल)

Definition (परिभाषा):
Combines relational 
और object-oriented features.
Hindi: Relational 
और object-oriented दोनों features को combine करता है।

 Advantages (फायदे):

  • Complex data types और relationships support करता है
  • Pure relational model से ज़्यादा flexible
  • Modern applications के लिए अच्छा

 Disadvantages (नुकसान):

  • Complexity ज़्यादा होती है
  • Design और manage करने के लिए advanced skill चाहिए
  • Optimize न हो तो performance reduce हो सकती है

3. Concept of Key in DBMS

DBMS में Key की अवधारणा (Concept of Key in DBMS)

परिभाषा (Definition):

Key एक attribute या attributes का समूह होता है जिसका उपयोग database table में प्रत्येक record को अद्वितीय (uniquely) पहचानने के लिए किया जाता है।
यह tables के बीच संबंध (relationships) बनाने और लागू करने में भी मदद करता है।


1. Primary Key (प्राथमिक कुंजी)

परिभाषा:

Primary Key वह field (या fields का समूह) होती है जो table के हर record को अलग-अलग पहचान देती है।
• इसमें NULL value नहीं हो सकती
• एक table में केवल एक ही Primary Key हो सकती है।

उदाहरण:

Student table में StudentID primary key हो सकती है क्योंकि यह हर student को uniquely पहचानती है।

✅ Primary Key के लाभ

  1. विशिष्टता सुनिश्चित करती है – दो records की primary key समान नहीं हो सकती।

  2. डेटा अखंडता बनाए रखती है – tables के बीच सही संबंध बनाए रखने में मदद करती है।

  3. तेज़ डेटा प्राप्ति – आमतौर पर automatic indexing होती है, जिससे search तेज़ होती है।

  4. Referential Integrity को समर्थन – अन्य tables में foreign key के रूप में प्रयोग की जा सकती है।

  5. Update और Delete आसान – records की स्पष्ट पहचान होने से errors कम होते हैं।

❌ Primary Key के नुकसान

  1. आसानी से बदली नहीं जा सकती – बदलने पर related tables प्रभावित हो सकती हैं।

  2. NULL नहीं हो सकती – हर record में value होना ज़रूरी है।

  3. जटिलता बढ़ाती है – सही primary key चुनना कठिन हो सकता है।

  4. Dependency समस्या – parent table में बदलाव child table को प्रभावित करता है।

  5. बड़े tables में overhead – indexing से performance थोड़ा प्रभावित हो सकता है।


2. Candidate Key (उम्मीदवार कुंजी)

परिभाषा:

Candidate Key वह attribute (या attributes का समूह) होता है जो table के प्रत्येक record को uniquely पहचान सकता है
• एक table में एक से अधिक candidate keys हो सकती हैं।
• इन्हीं में से एक को Primary Key चुना जाता है।

उदाहरण:

Student table में:
StudentID और Email दोनों student को uniquely पहचान सकते हैं।
• इनमें से कोई एक primary key बन सकता है, दूसरा candidate key रहेगा।

✅ Candidate Key के लाभ

  1. विशिष्ट पहचान – हर record को uniquely पहचानने की क्षमता।

  2. Primary Key चुनने में विकल्प – बेहतर attribute चुनने में मदद।

  3. डेटा अखंडता बनाए रखती है

  4. Relationships को support – foreign key के रूप में उपयोग हो सकता है।

  5. लचीलापन – records पहचानने के कई विकल्प मिलते हैं।

❌ Candidate Key के नुकसान

  1. जटिलता बढ़ती है – अधिक candidate keys से design कठिन हो जाता है।

  2. Maintenance overhead – सभी candidate keys की uniqueness बनाए रखनी पड़ती है।

  3. NULL स्वीकार नहीं – valid value होना ज़रूरी है।

  4. Dependency समस्या – बदलाव से foreign key प्रभावित हो सकती है।

  5. सही चयन कठिन – सबसे उपयुक्त key चुनना आसान नहीं होता।


3. Foreign Key (विदेशी कुंजी)

परिभाषा:

Foreign Key वह attribute (या attributes) होता है जो किसी अन्य table की primary key को refer करता है।
• यह दो tables के बीच संबंध स्थापित करता है।
• Referential Integrity बनाए रखता है।

उदाहरण:

Enrollment table में StudentID, Student table की StudentID को refer करती है।

✅ Foreign Key के लाभ

  1. Referential Integrity बनाए रखती है

  2. Orphan records रोकती है – बिना parent record के data insert नहीं होने देती।

  3. Relationships स्पष्ट करती है

  4. डेटा की शुद्धता सुनिश्चित करती है

  5. Database को व्यवस्थित बनाती है

❌ Foreign Key के नुकसान

  1. Insert/Update/Delete पर प्रतिबंध – नियम न मानने पर operation fail हो सकता है।

  2. Performance धीमी – constraint check में समय लगता है।

  3. Design जटिल बनता है

  4. Dependency समस्या – parent table में बदलाव child table को प्रभावित करता है।

  5. NULL की सीमा – कई designs में NULL allowed नहीं होता।


4. Composite Key (संयुक्त कुंजी)

परिभाषा:

Composite Key वह primary key होती है जो दो या अधिक attributes से मिलकर बनती है।
• कोई एक attribute अकेले record को uniquely पहचान नहीं पाता।

उदाहरण:

Enrollment table:

| StudentID | CourseID | Grade |

• StudentID या CourseID अकेले unique नहीं हैं।
StudentID + CourseID मिलकर composite key बनाते हैं।

✅ Composite Key के लाभ

  1. विशिष्ट पहचान सुनिश्चित – जब single attribute पर्याप्त न हो।

  2. Duplicate entries रोकती है

  3. Relationships को support करती है

  4. लचीलापन – आवश्यकता अनुसार attributes जोड़े जा सकते हैं।

  5. Many-to-Many relationships में उपयोगी

❌ Composite Key के नुकसान

  1. जटिलता – single key की तुलना में उपयोग कठिन।

  2. बड़ा index – performance कम हो सकती है।

  3. Maintenance कठिन – किसी भी attribute में बदलाव से सभी relations प्रभावित।

  4. User-friendly नहीं – समझना और याद रखना मुश्किल।

  5. Foreign key जटिलता – सभी attributes को refer करना पड़ता है।

4. DBMS में Constraints

DBMS में Constraints (नियम / प्रतिबंध)

परिभाषा (Definition):

Constraint वह नियम होता है जो database table पर लगाया जाता है ताकि डाले जाने वाले, बदले जाने वाले या हटाए जाने वाले data पर नियंत्रण रखा जा सके।
इसका उद्देश्य डेटा की शुद्धता, एकरूपता और अखंडता बनाए रखना होता है।


Constraints के सामान्य प्रकार (Common Types of Constraints)

  1. Primary Key Constraint (प्राथमिक कुंजी नियम)
    – प्रत्येक record की अद्वितीय पहचान सुनिश्चित करता है।

  2. Foreign Key Constraint (विदेशी कुंजी नियम)
    – tables के बीच referential integrity बनाए रखता है।

  3. Unique Constraint (अद्वितीयता नियम)
    – किसी column के सभी values को अलग-अलग होने की गारंटी देता है।

  4. Not Null Constraint (NOT NULL नियम)
    – सुनिश्चित करता है कि column में NULL value न हो

  5. Check Constraint (जाँच नियम)
    – यह सुनिश्चित करता है कि column की value निर्धारित शर्त को पूरा करे।

  6. Default Constraint (डिफ़ॉल्ट नियम)
    – यदि कोई value न दी जाए तो column को पूर्व-निर्धारित value देता है।


✅ Constraints के लाभ (Advantages of Constraints)

  1. डेटा अखंडता बनाए रखता है
    – डेटा की शुद्धता और एकरूपता सुनिश्चित करता है।

  2. अमान्य डेटा को रोकता है
    – गलत या अनुपयुक्त values को insert होने से रोकता है।

  3. Referential Integrity को समर्थन
    – Foreign key orphan records बनने से रोकती है।

  4. Application Logic सरल बनाता है
    – Application level पर data validation की आवश्यकता कम हो जाती है।

  5. विश्वसनीयता बढ़ाता है
    – Database को वास्तविक दुनिया के नियमों के अनुरूप बनाता है।


❌ Constraints के नुकसान (Disadvantages of Constraints)

  1. Performance धीमी हो सकती है
    – Insert, update या delete के समय नियम जाँचने में समय लगता है।

  2. जटिलता बढ़ती है
    – अधिक constraints database design को कठिन बनाते हैं।

  3. कठोर संरचना (Rigid Structure)
    – Schema में बदलाव करना मुश्किल हो सकता है।

  4. Dependency समस्याएँ
    – Constraint violation होने पर operations रुक सकते हैं।

  5. अतिरिक्त storage की आवश्यकता
    – कुछ constraints (जैसे unique index) extra memory लेते हैं।

5. Strong Entity Set

Strong Entity Set (मज़बूत एंटिटी समुच्चय)

परिभाषा (Definition):

Strong Entity Set वह entity set होता है जिसके पास अपनी स्वयं की primary key होती है और जिसे किसी अन्य entity पर निर्भर हुए बिना uniquely पहचाना जा सकता है।
• यह पहचान के लिए किसी दूसरी entity पर निर्भर नहीं होता।

उदाहरण (Example):

Student (StudentID, Name, Age) – यहाँ StudentID प्रत्येक student को uniquely पहचानता है।


✅ Strong Entity Set के लाभ (Advantages)

  1. स्वतंत्र पहचान – बिना किसी अन्य entity की मदद के uniquely पहचाना जा सकता है।

  2. सरल संरचना – Design करना और समझना आसान होता है।

  3. डेटा अखंडता – Primary key uniqueness सुनिश्चित करती है।

  4. Relationships का समर्थन – अन्य entities के साथ संबंध बना सकता है।


❌ Strong Entity Set के नुकसान (Disadvantages)

  1. सीमित संदर्भ – आश्रित (dependent) entities को स्वाभाविक रूप से दर्शा नहीं सकता।

  2. अतिरिक्त attributes की आवश्यकता – जटिल relationships में extra attributes जोड़ने पड़ सकते हैं।

6. Weak Entity Set

Weak Entity Set (कमज़ोर एंटिटी समुच्चय)

परिभाषा (Definition):

Weak Entity Set वह entity set होता है जिसे केवल अपने attributes के आधार पर uniquely पहचाना नहीं जा सकता
• यह पहचान के लिए किसी Strong Entity (मालिक एंटिटी) पर निर्भर करता है।
• पहचान के लिए Partial Key का उपयोग किया जाता है।
• जो relationship इन्हें जोड़ती है, उसे Identifying Relationship (पहचान संबंध) कहा जाता है।

उदाहरण (Example):

Dependent (DependentName, StudentID)
यहाँ DependentName अकेले unique नहीं है, लेकिन StudentID (Student entity से) के साथ मिलकर एक unique key बनाता है।


✅ Weak Entity Set के लाभ (Advantages)

  1. आश्रित डेटा को दर्शाता है – उन entities के लिए उपयोगी जो किसी अन्य entity पर निर्भर हों।

  2. Referential Integrity बनाए रखता है – हमेशा strong entity से जुड़ा रहता है।

  3. जटिल संबंधों का समर्थन – One-to-many जैसे dependent संबंधों को अच्छे से संभालता है।


❌ Weak Entity Set के नुकसान (Disadvantages)

  1. स्वतंत्र रूप से अस्तित्व नहीं – पहचान के लिए strong entity आवश्यक होती है।

  2. जटिल डिज़ाइन – Identifying relationship और composite key की जरूरत होती है।

  3. निर्भरता बोझ – Strong entity में बदलाव से weak entity प्रभावित हो सकती है।


🔸 Strong Entity और Weak Entity का तुलनात्मक तालिका (Table)

एंटिटी समुच्चय का प्रकार परिभाषा लाभ नुकसान
Strong Entity अपने attributes से uniquely पहचानी जा सकती है स्वतंत्र पहचान, सरल डिज़ाइन, relationships को support आश्रित डेटा को स्वाभाविक रूप से नहीं दर्शा सकती
Weak Entity अकेले uniquely पहचानी नहीं जा सकती; strong entity पर निर्भर आश्रित डेटा को दर्शाती है, अखंडता बनाए रखती है, जटिल संबंधों का समर्थन स्वतंत्र अस्तित्व नहीं, डिज़ाइन जटिल, निर्भरता अधिक