Unit 3.3b: Relational Model and ERD (LH4)

--:-- --
↓ Scroll for more

Unit 3.3b (LH4)

Relational Model + ERD

IT 233 — 1 lecture hour | Second half of u3-c3 note

🎯 Objectives

  • ✅ Tables, rows, columns, PK, FK, constraints.
  • ✅ 1:N vs M:N → linking table (ENROLLMENT).
  • ✅ Read ERD → tables; 3NF idea.

Relational Building Blocks

ObjectMeaningCollege cue
TableOne entity typeSTUDENT, COURSE
Row / ColumnInstance / propertyS101 / Address
PKUnique per rowStudentID, CourseID
FKPK copy linking tablesStudentID in ENROLLMENT
ConstraintDBMS ruleGrade in list, email unique

Relationships

  • 1:N: FK on many side (CUSTOMER → ORDER).
  • M:N: needs link table (STUDENT—COURSE via ENROLLMENT + Grade).
  • ERD is the drawing; tables are the build. 3NF: non-key depends on key, whole key, nothing but key.

College Tables (BS 2081)

STUDENT: S101 Sita/Bhaktapur; S102 Ram/Lalitpur

ENROLLMENT: (S101,IT233,A), (S101,IT204,B+), (S102,IT233,A−)

Rules: address once; PK blocks dupes; FK blocks orphans; grade check.

🧮 Try This (5 min)

Build Rs.195,000; run Rs.7,500/mo; saves 28h/mo @Rs.550 + Rs.10,800/term ×3.

Gross 15,400+2,700=Rs.18,100. Net Rs.10,600/mo. Payback 19 mo.

Takeaways + Exam

  • PK identifies, FK links, constraints protect; M:N needs link.
  • Short: PK vs FK (college); what is ERD.
  • Long: Draw Member–Account–Loan ERD, keys + 3 constraints.

Full case: u3-c3 note.