Question

Entity Types

enter image description here

Workstation -> Supertype
Desktop, Laptop -> Subtypes

Desktop and Laptop share the PK with the Workstation Entity Supertype

Relationships

Site – Person -> 1:n
Workstation – Desktop -> 1:1
Workstation – Laptop -> 1:1

Relationships to be modeled

One person has assigned zero or one desktop
One desktop is assigned to zero or one person
One person has assigned zero or one laptop
One laptop is assigned to zero or one person
One site has deployed zero, one or more desktops
One desktop is deployed at one site

Q: Is my thinking correct that Person and Site relationships should be modelled with the subtypes i.e. Desktop and Laptop rather than the supertype?

For example, a laptop is not deployed to a particular site, so creating a relationship between the supertype and a location doesn't make sense.

Thank you

Was it helpful?

Solution

Is my thinking correct that Person and Site relationships should be modelled with the subtypes i.e. Desktop and Laptop rather than the supertype?

If I understand you correctly, yes.

The issue for computers, for example, is whether the real requirement is that one person has assigned zero or one computer. If that's the real requirement, then you should use the supertype. If not, you should use the subtypes.

One of the side effects of using the subtypes is that a person might be assigned both a laptop and a desktop.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top