ER Diagram Symbols और Examples
Symbols क्यों ज़रूरी हैं
ER diagram standard आकार इस्तेमाल करता है ताकि कोई भी database design एक नज़र में पढ़ सके। हर symbol का fixed मतलब है — rectangle हमेशा entity, oval हमेशा attribute। ये कुछ symbols सीखना आपको कोई भी ER diagram पढ़ने और बनाने देता है।
Rectangle — entity
- Rectangle — सामान्य entity (Student, Book, Order)।
- Double rectangle — weak entity, जिसे पहचानने को दूसरी entity चाहिए (जैसे Employee से जुड़ा Dependent)।
Diagram database में बनने पर entities tables बनती हैं।
Oval — attribute
- Oval — सामान्य attribute (name, age)।
- Underlined oval — key attribute (primary key, जैसे roll)।
- Double oval — multivalued attribute (कई रख सकता, जैसे phone numbers)।
- Dashed oval — derived attribute (गणना किया, जैसे date of birth से age)।
Attributes अंतिम tables में columns बनते हैं।
Diamond — relationship
- Diamond — entities के बीच relationship (Student "enrolls" Course)।
- Double diamond — identifying relationship, weak entity को उसके owner से जोड़ता।
Relationships database में foreign keys या link tables बनते हैं।
Lines और cardinality
Lines entities को उनके attributes और relationships से जोड़ती हैं। Relationship lines पर, cardinality चिह्नित होती है यह दिखाने को कितने जुड़ते हैं:
- 1 : 1 — one-to-one।
- 1 : N — one-to-many।
- M : N — many-to-many।
कुछ diagrams अक्षरों के बजाय crow's-foot notation (कांटेदार line) इस्तेमाल करते हैं।
ख़ास आकार
| Symbol | मतलब |
|---|---|
| Rectangle | Entity |
| Double rectangle | Weak entity |
| Oval | Attribute |
| Underlined oval | Key attribute |
| Double oval | Multivalued attribute |
| Dashed oval | Derived attribute |
| Diamond | Relationship |
आम गलतियाँ
- Oval और diamond मिलाना। Oval attribute है; diamond relationship।
- Key underline करना भूलना। Key attribute underline होना चाहिए।
- Cardinality labels अनदेखा करना। इनके बिना relationship प्रकार अस्पष्ट है।
- Weak entity को single rectangle इस्तेमाल करना। Weak entities double rectangle इस्तेमाल करती हैं।
सारांश
- ER diagrams fixed symbols इस्तेमाल करते हैं जो कोई भी पढ़ सके।
- Rectangle = entity; double rectangle = weak entity।
- Oval = attribute; underlined = key, double = multivalued, dashed = derived।
- Diamond = relationship; double diamond = identifying।
- Lines cardinality रखती हैं (1:1, 1:N, M:N)।
आगे, हिस्से समझिए ER model में, या उन्हें साथ देखिए ER diagram examples में।
