Skip to main content

Chapter 2 · Watch, then practise

Data Models

Represent real requirements as entities, attributes and relationships before mapping the design into tables.

3 questions · 3 with related videos. Matches are based on playlist titles; broader background matches are labeled.

What to study

  • Entity and attribute
  • Relationship cardinality
  • Mandatory and optional participation
  • Mapping many-to-many relationships

Chapter playlists

Choose a playlist

Notes

Lec-16: Introduction to ER model | ER Model क्या है

Gate Smashers · 8:32

Choose a video · 2 lectures

ER-model concepts and an ER-diagram example support the student-enrollment model; the example is not this exact exercise.

1. Entities and relationships

Model students enrolling in courses. What are the main parts?

Student and Course are entity types. Student ID and course code identify instances; names are descriptive attributes. Enrolls is a relationship, with grade or enrollment date as possible relationship attributes. Begin with the facts the system needs to record, then choose tables.

DBMS - Mapping Cardinalities in ER-Diagram

TutorialsPoint · 6:00

Choose a video · 2 lectures

Cardinality and one-to-many relationships are the matching topics. Use the answer for the separate optional-participation condition.

2. Cardinality versus participation

Can a one-to-many relationship also be optional?

Yes. Cardinality limits how many related instances are allowed; participation says whether at least one is required. A department can employ many lecturers while temporarily employing none. A lecturer can be required to belong to exactly one department. Specify both ends separately.

Lec-20: Many to Many Relationship in DBMS | M-N Relationship

Gate Smashers · 10:47

Many-to-many relationships are the relevant modeling pattern for an enrollment junction table.

3. Many-to-many mapping

How do you map student enrollment to relational tables?

Create Student, Course and Enrollment(student_id, course_id, grade). The two IDs in Enrollment are foreign keys. If a student may enroll in a course only once, their pair is a candidate key; if repeats are allowed, include an offering or attempt identifier.

References