TheHingineer

  • DBMS


  • DBMS Part-1

  • DBMS Part-2

  • DBMS Part-3

  • DBMS Part-4

  • DBMS Part-5

  •  E-R Diagram in DBMS 


     E-R Diagram kya hota hai?

    E-R Diagram ka full form hai Entity-Relationship Diagram.

    Ye ek drawing ya diagram hoti hai jo batata hai ki database ke objects (entities) ka data kya hai aur wo ek dusre se kaise jude hue hain (relationships).

    Jaise architect ghar banane se pehle blueprint banata hai, waise hi database banane se pehle hum E-R diagram banate hain.

     E-R Diagram ka use kyu hota hai?

    • Database ko visual form mein samajhne ke liye.

    • Entities, unke attributes aur unke beech ke relations ko dikhane ke liye.

    • Database design karne se pehle planning ke liye.

    • Developers aur stakeholders ke beech communication ke liye.

     E-R Diagram ke Main Elements:

    ElementHindi mein matlabSymbol (Nishaan)
    EntityReal-world object jiska data chahiyeRectangle 
    AttributeEntity ka feature ya propertyOval 
    RelationshipEntity ke beech ka connectionDiamond 
    Primary KeyEntity ki unique pehchanUnderlined text
    Multi-valued AttributeJisme ek se zyada values hoDouble Oval
    Derived AttributeJo calculate karke milta haiDashed Oval

     Example: University Database

    Agar hum ek University ka database banayein:

    • Entities: Student, Course

    • Attributes:

      • Student → Student_ID, Name, Age

      • Course → Course_ID, Title

    • Relationship: Enrolls (Student enrolls in Course)

     E-R Diagram:

    ER Diagram in DBMS
     

     Student aur Course do entities hain
     Enrolls unke beech ka relationship hai

    (Student_ID aur Course_ID Primary key hain)

     Relationship Types

    TypeMeaningExample
    One-to-One (1:1)Ek entity sirf ek dusri se judi haiStudent ↔ ID Card
    One-to-Many (1:N)Ek entity, kai dusri se judi haiTeacher → Multiple Students
    Many-to-Many (M:N)Dono side kai entries hainStudents ↔ Courses

     Kaise banayein E-R Diagram?

    1. 1. Entities identify karo
      Jaise: Student, Course, Book

    2.  

    3.  

    4. 2. Attributes identify karo
      Jaise: Student ke liye – Name, Age, ID

    5.  

    6.  

    7. 3. Relationships dhoondo
      Jaise: Student enrolls in Course

    8.  

    9.  

    10. 4. Diagram draw karo
      Rectangle = Entity, Oval = Attribute, Diamond = Relationship

     E-R Diagram ke Fayde

    • -> Database ka structure easily samajh aata hai

    • -> Galti hone ka chance kam hota hai

    • -> Planning aur communication better hoti hai

    • -> Relational schema banane mein help milti hai


     Quick Summary Table

    CheezSymbolExample
    EntityRectangleStudent, Book, Teacher
    AttributeOvalName, Age, Course_ID
    RelationshipDiamondEnrolls, Teaches, Issues
    Primary KeyUnderlinedStudent_ID
    Derived AttributeDashed OvalAge (DOB se calculate hota hai)
    Multi-valued Attr.Double OvalPhone Numbers
    Scroll to Top