In a table per type architecture, say I have a type Person with two sub-types student and teacher. A student cannot be a teacher, and a teacher cannot be a student.
Below is the best way I know how to set these up so far:
Geometry
ID int, PK
Name string
Point
ID int, PK, FK
X float
Y float
Line
ID int, PK, FK
StartPoint int, FK
EndPoint int, FK
Note that for the sub-types the primary key is also a foreign key to Geometry. How can I ensure that there is no Geometry that is both a Point and a Line? Is there some kind of mutually exclusive constraint?
If the only solution is to use something like triggers that are vendor-specific am I better of doing that or enforcing this somewhere else like the communication later or client?
thank you!