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

turtle@lemm.ee ⁨1⁩ ⁨week⁩ ago

I saw a comment about this in the last couple of days that was really interesting and educational. Unfortunately I can’t seem to find it again to link it, but the gist of it was that there would be two things wrong with using SSNs as primary keys in a SQL database:

Using SSNs as keys would violate both.

I went looking for best practices regarding SQL primary keys and found this really interesting post and discussion on Stack Overflow:

stackoverflow.com/…/whats-the-best-practice-for-p…

My first thought was that people’s SSNs can and do change, and sometimes (rarely?) people may have more than one SSN. Like someone mentions in that link, human error would be another reason why you would not want to use external data and particularly SSNs as primary keys.

source
Sort:hotnewtop