CS FundamentalsVery hardGATE CS (PYQ pattern)

An ER diagram has a supertype PERSON(pid, name) with disjoint, total specialisation into STUDENT(gpa) and TEACHER(salary). Using the 'one table per subtype, no supertype table' mapping, how many tables hold the data and what is the PRIMARY KEY of each?

  1. A. 3 tables, with pid as the key of PERSON only
  2. B. 2 tables, keyed by name
  3. C. 2 tables, STUDENT(pid, name, gpa) and TEACHER(pid, name, salary), each keyed by pid
  4. D. 1 table with pid and a type column

Correct answer: C. 2 tables, STUDENT(pid, name, gpa) and TEACHER(pid, name, salary), each keyed by pid

For a disjoint total specialisation, each subtype table copies the supertype attributes (pid, name) plus its own, and pid remains the key; no PERSON table is needed because every person is a student or a teacher.

More DBMS and SQL questions

Exams that ask this topic