Comment on How does this pic show that Elon Musk doesnt know SQL?
DahGangalang@infosec.pub 6 days agoYeah, databases are complicated and make my head hurt. Glancing through resources from other comments, I’m realizing I know next to nothing about database optimization. Like, my gut reaction to your comment is that it seems like unnecessary overhead to have that data across two tables - but if one sub-dept didn’t need access to the raw SSN, but did need access to less personal data, j could see those stored in separate tables.
But anyway, you’re helping clear things up for me. I really appreciate the pseudo code level example.
Barbarian@sh.itjust.works 6 days ago
It’s necessary to split it out into different tables if you have a one-to-many relationships. Let’s say you have a list of driver licenses the person has had over the years, for example. Then you’d need the second table. So something like this:
SSN_TABLE
ID | SSN | Other info
Driver_License_Table
ID | SSN_ID | Issue_Date | Expiry_Date | Other_Info
Then you could do something like pull up a person’s latest driver’s license, or list all the ones they had, or pull up the SSN associated with that person.
Arcka@midwest.social 5 days ago
I think a likely scenario would be for name changes, such as taking your partner’s surname after marriage.