Linux server admin, MySQL/TSQL database admin, Python programmer, Linux gaming enthusiast and a forever GM.

  • 0 Posts
  • 4 Comments
Joined 2 years ago
cake
Cake day: June 8th, 2023

help-circle

  • Theoretically, yeah, that’s one solution. The more reasonable thing to do would be to use the foreign key though. So, for example:

    SSN_Table

    ID | SSN | Other info

    Other_Table

    ID | SSN_ID | Other info

    When you want to connect them to have both sets of info, it’d be the following:

    SELECT * FROM SSN_Table JOIN Other_Table ON SSN_Table.ID = Other_Table.SSN_ID

    EDIT: Oh, just to clear up any confusion, the SSN_ID in this simple example is not the SSN itself. To access that in this example query, it’d by SSN_Table.SSN