How to Implement Referential Integrity in Subtypes
问题 I have the following tables in a relational database: [Sensor] LocationId [PK / FK -> Location] SensorNo [PK] [AnalogSensor] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] UpperLimit LowerLimit [SwitchSensor] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] OnTimeLimit [Reading] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] ReadingDtm [PK] [ReadingSwitch] LocationId [PK/FK -> Reading] SensorNo [PK/FK -> Reading] ReadingDtm [PK/FK -> Reading] Switch [ReadingValue]