I am working on a program in which you can register complaints. There are three types of complaints: internal (errors from employees), external (er
In response to you're comment on the accepted answer:
Below is a way to have a check check to ensure only one of the three keys has data:
alter table complaint_master
add constraint loc_attribute_has_one_value
check (
(case when complaint_employee is null then 0 else 1 end) +
(case when complaint_supplier is null then 0 else 1 end) +
(case when complaint_external is null then 0 else 1 end) = 1
);