Comment on How does this pic show that Elon Musk doesnt know SQL?

<- View Parent
Barbarian@sh.itjust.works ⁨5⁩ ⁨days⁩ ago

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

source
Sort:hotnewtop