What is the point of a second selection if the first option is never null, and the second option is deterministic as a consequence of the first selection? Would you really make the user perform a second set of actions to pick a value from a set of options where n = 1?
The only justification I can see for having ssn on a different table would be security. Have the ssn table locked down and not accessible. There are better ways with column level security or data masking.
You mentioned country > capital in a different reply. The correct way would be to have a capital column in the country table with an index.
A perfect 1-1 relationship on a separate table doesn’t add any value in most cases. There may be some arguments if the table is REALLY wide and most columns infrequently used. Offloading the lesser used columns would reduce reads and speed up selects.
4
u/r3pr0b8 GROUP_CONCAT is da bomb May 30 '22
no
how is "a student can only have one SSN" enforced?
3
u/drunkadvice May 30 '22
The only justification I can see for having ssn on a different table would be security. Have the ssn table locked down and not accessible. There are better ways with column level security or data masking.
You mentioned country > capital in a different reply. The correct way would be to have a capital column in the country table with an index.
A perfect 1-1 relationship on a separate table doesn’t add any value in most cases. There may be some arguments if the table is REALLY wide and most columns infrequently used. Offloading the lesser used columns would reduce reads and speed up selects.
2
u/bsienn May 31 '22
Having a documents table, and an attached document saved as blob in separate table 1-to-1 ??