If I have a table with multiple optional keys, is it better to have a single table with nullable keys or multiple tables with not nullable keys.
One benefit I could see is the separate tables would permit all keys to be not null which would be better for data integrity.
SINGLE_TABLE
KEY1 KEY2 KEY3 VALUE
-----------------------------------------
1 NULL NULL ValueA
1 2 NULL ValueB
1 2 3 ValueC
or
TABLE_1
KEY1 VALUE
---------------
1 ValueA
TABLE_2
KEY1 KEY2 VALUE
--------------------------
1 2 ValueB
TABLE_3
KEY1 KEY2 KEY3 VALUE
-----------------------------------------
1 2 3 ValueC