3 ms·
Have a table for people and then two tables for 'females' (defined as capable of pregnancy) and 'others'. The two tables link back to the people table with an f
by jarek 14y ago
Have a table for people and then two tables for 'females' (defined as capable of pregnancy) and 'others'. The two tables link back to the people table with an fkey and each person from the people table has their own row in the applicable table. Then have a 'pregnant' table with an fkey back to 'females' table and a boolean column. Edit: or just the boolean column in 'females' table as danielmiller suggested
This is of course ridiculous so you should just use triggers or application layer, that's how logical data restrictions are meant to be enforced.