Let's say I have a table where I'm recording certain events that have happened to a "thing".
Some events will be being moved from one place to another, but other events will be, for example, a repair being done. To do this there will be an event type field. What I want to happen is that when the event type is "repair" for example, it forces there to be another entry in another field that points to a repair detail table holding the detail of the repair.
To paraphrase, when the event type is "movement" the "repairID" field can be empty. When the event type is "repair" the "repairID" field must have an entry.
I know I could do this at application level, but it feels neater at database level.
There's a further question around creating the repair detail, but let's sort this one first.
Tried googling, but wasn't really sure of the correct term.