This sounds like a reasonable argument.
Can you pass any resources with examples on when having duplicate values would be useful/best practices?
Comment on How does this pic show that Elon Musk doesnt know SQL?
jacksilver@lemmy.world 1 week ago
If SSNs are used as a primary key (a unique identifier for a row of data) then they’d have to be duplicated to be able to merge data together.
However, even if they aren’t using ssn as an identifier as it’s sensitive information. It’s not uncommon to repeat data either for speed/performance sake, simplicity in table design, it’s in a lookup table, or you have disconnected tables.
Having a value repeated doesn’t tell you anything about fraud risk, efficency, or really anything. Using it as the primary piece of evidence for a claim isn’t a strong arguement.
This sounds like a reasonable argument.
Can you pass any resources with examples on when having duplicate values would be useful/best practices?
Sure, basically any time you have a many-to-many relationship you’ll have to repeat keys multiple times. Think students taking courses. You’d have a students table and a courses table, but the relationship is many students take many courses. So you’d want a third table for lookups where each row is [student_id, course_id].
This stackoverflow post has a similar example with authors and books - stackoverflow.com/…/how-do-i-model-a-many-to-many…
credo@lemmy.world 1 week ago
This is the answer… it seems few on lemmy have ever normalized a database. But they do know how to give answers!
jacksilver@lemmy.world 1 week ago
Thanks, OP seemed more curious about the technical aspects than just the absurdity of the comment (since pretty much every business uses SQL) so hoped a more technical explanation might be appreciated.