Entity Relationship Diagram. How does the IS A relationship translate into tables?

Assuming the relationship is mandatory (as you said, a person has to be a student or a teacher) and disjoint (a person is either a student or a teacher, but not both), the best solution is with 2 tables, one for students and one for teachers.

If the participation is instead optional (which is not your case, but let's put it for completeness), then the 3 tables option is the way to go, with a Person(PersonID, Name) table and then the two other tables which will reference the Person table, e.g. Student(PersonID, GPA), with PersonID being PK and FK referencing Person(PersonID).

The 1 table option is probably not the best way here, and it will produce several records with null values (if a person is a student, the teacher-only attributes will be null and vice-versa).

If the disjointness is different, then it's a different story.


there are 4 options you can use to map this into an ER,

option 1

  • Person(SIN,Name)
  • Student(SIN,GPA)
  • Teacher(SIN,Salary)

option 2 Since this is a covering relationship, option 2 is not a good match.

  • Student(SIN,Name,GPA)
  • Teacher(SIN,Name,Salary)

option 3

  • Person(SIN,Name,GPA,Salary,Person_Type) person type can be student/teacher

option 4

  • Person(SIN,Name,GPA,Salary,Student,Teacher) Student and Teacher are bool type fields, it can be yes or no,a good option for overlapping

Since the sub classes don't have much attributes, option 3 and option 4 are better to map this into an ER