I'm designing a domotic system database and I'm trying to figure out how to represent two foreign keys.
This is the cardinality I want. Consider 1...N Areas (rooms, halls, kitchens, etc.):
Area 1 - has - N PeripheralUnit (where N ∈ ℕ) PeripheralUnit 1 - contains - N Device (that can be either sensors or actuators)
My question is if the table Device needs to inherit as foreign key the Area id from PeripheralUnit or maybe from Area, directly.
This is my design:
Maybe I don't need at all to introduce the Area id as a FK in Device, because I can find it in PeripheralUnit.
Need your advice please.