Progressive Full Stack Application Development with Live Projects

Server Engineering

ER Diagram Structure of a Learning Management System

  • User (id, name, email) —< Enrollment >— Course (id, title)
  • Course (id, title) —< Lesson >— Lesson (id, title, content)
  • Course (id, title) —< Assignment >— Assignment (id, title, description)
  • Assignment (id, title, description) —< Grade >— Grade (id, score)
  • Enrollment (id, userId (FK), courseId (FK))
  • Grade (id, score, userId (FK), assignmentId (FK))

User

  • Attributes: id (PK), name, email
  • Relationships:
    • Many-to-Many with Course: A user can enroll in multiple courses, and a course can have many users. This is captured via the Enrollment entity.
    • One-to-Many with Enrollment: A user can have multiple enrollments.
    • One-to-Many with Grade: A user can receive multiple grades for assignments.

Course

  • Attributes: id (PK), title
  • Relationships:
    • One-to-Many with Lesson: A course can have multiple lessons.
    • One-to-Many with Assignment: A course can have multiple assignments.
    • Many-to-Many with User: A course can have many users (students).
    • One-to-Many with Enrollment: A course can have multiple enrollments.

Lesson

  • Attributes: id (PK), title, content
  • Relationships:
    • Many-to-One with Course: Each lesson belongs to a single course.

Enrollment

  • Attributes: id (PK), userId (FK), courseId (FK)
  • Relationships:
    • Many-to-One with User: Each enrollment is associated with one user.
    • Many-to-One with Course: Each enrollment is associated with one course.

Assignment

  • Attributes: id (PK), title, description, courseId (FK)
  • Relationships:
    • Many-to-One with Course: Each assignment is part of a course.
    • One-to-Many with Grade: Each assignment can have multiple grades (one per student).

Grade

  • Attributes: id (PK), score, userId (FK), assignmentId (FK)
  • Relationships:
    • Many-to-One with User: Each grade is assigned to a user (student).
    • Many-to-One with Assignment: Each grade is associated with a specific assignment.