TEST has many
However, the catch is that a
TEST instance must have exactly 5 instances of
CASE (1 to 5).
I could do something like this:
create table TEST ( ID Integer not null, CASE1_OK varchar not null, CASE2_OK varchar not null, CASE3_OK varchar not null, CASE4_OK varchar not null, CASE5_OK varchar not null, CHECK (CASE1_OK IN ('PASS', 'FAIL', 'INVESTIGATE')) , ... constraint pk_TEST primary key (ID) ) ;
That's obviously a violation of 1NF.
Is there a way of having a separate
CASE table while ensuring that
TEST record can not be inserted without having exactly 5 existing
CASE rows for it?