MySQL + SQL · Lesson 22

School Database के लिए ER Diagram Examples

Practical ER Diagrams

यहाँ common ER diagram scenarios हैं जो exams में पूछे जाते और real projects में use होते हैं।

School ER Diagram

Entities: Student, Class, Teacher, Subject।

  • एक Class में कई Students (1:N)।
  • एक Teacher कई Subjects पढ़ाता है (1:N)।
  • एक Student कई Subjects पढ़ता है (M:N)।

Library ER Diagram

Entities: Member, Book, Issue।

  • एक Member कई Books borrow करता है (M:N, Issue table से resolve)।
  • Issue में member_id, book_id, issue_date, return_date।

M:N को Convert करना

Many-to-many relationship एक junction table में बदलती है जिसमें दो foreign keys होती हैं। Example: student_subject(roll_no, subject_id)

सारांश

  • Entities पहचानें, फिर उनके relationships और cardinality।
  • M:N relationships दो foreign keys वाली junction tables बनती हैं।
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।