I am trying to translate the ISA relationship in this ER diagram to database tables, and I am not sure how to enforce the total and disjoint participation constraint of Laptop and Desktop in Computer. (There are other attributes, but they are not shown here for simplicity.) Here are some options I've explored:
a) Have just one table for Computer, with the attributes of the subtypes in the parent entity. This is not an option, since some functional dependencies in the next part of the question forbid this. There isn't a "type" flag attribute in the diagram either.
b) Two tables, one each for Laptop and Desktop, and pull the attributes from Computer into the separate tables. I can't do this, since it would destroy the relationships that Computer has with other entities.
c) One table each for Computer, Desktop, and Laptop, with foreign key constraints on cid. I don't like this option, since it does not enforce the total and disjoint participation constraint.
This is a practice exercise, but there are no solutions. I would greatly appreciate any help!
/ \ ------------ / \ --------- (cid)--| Computer |====/Supplies\---| Store | -----||----- \ / --------- || \ \ / || \ || \ / \ --------------- /d \ \--/Fixes\------| TechSupport | (battery) ----- \ / --------------- \ / \ \ / --------- / \ ---------- | Laptop | | Desktop |--(monitor) ---------- -----------
desktop_id
andlaptop_id
in the Computer table.a) [...]This is not an option[...] b) [...]I can't do this[...] c) [...]I don't like this option[...]