Comment on How does this pic show that Elon Musk doesnt know SQL?
spankmonkey@lemmy.world 1 week agoIt is common for long lived databases with a rotating cast of devs to use different formats in different tables as well! One might have it as a string, one might have it as a number, and the other might have it with hyphens in the same database.
Hell, I work in a state agency and one of our older databases has a dozen tables with databases.
- One has the whole thing as a long int: 222333444
- One has the whole thing as a string: 2223334444 (which of course can’t be directly compared to the one that is a long int…)
- One has separate fields for area code and the rest with a hyphen: 222 and 333-4444
- One has the whole thing with parenthesis, a space, and a hyphen as a string: (222) 333-4444
The main reason for the discrepancy is not looking at what was used before or not understanding that they can always change the formatting when displayed so they don’t need to include the parenthesis or hyphens in the database itself.
pixxelkick@lemmy.world 1 week ago
Okay but if that happens, musk is right that that’s a bit of a denormalization issue that mayne needs resolving.
SSNs should be stored as strings without any hyphen or additional markup, nothing else.
It’s more likely though it’s just a composite key…
spankmonkey@lemmy.world 1 week ago
This is not what he is actively doing though. He isn’t trying to improve databases.
He is tearing down entire departments and agencies and using shit like this to justify it.
pixxelkick@lemmy.world 1 week ago
Sure but my point is, if it was the scenario you described, then Elon would be talking about the right kind of denormalization problem.
Denormalization due to multiple different storing their own copies if the same data, in different formats worse yet, would actually be the kind if problem he’s tweeting about.
As opposed to a composite key on one table which means him being an ultracrepidarian, as usual.
spankmonkey@lemmy.world 1 week ago
Musk canceled the support for the long running Common Educstion Data Standards (CEDS) which is an initiative to promote better database standards and normalization for the states to address this kind of thing.
It does not fucking matter if he is technically correct about one tiny detail because he is only using to to destroy, not to improve efficiency.