this post was submitted on 19 Nov 2025
336 points (92.9% liked)
Programmer Humor
27391 readers
1782 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
To be honest, it's remarkably simple for what it's doing. There's a ton of details that are abstracted away. Databases are massively complex things, yet we can write simple queries to interact with them, with semantics that are well-understood and documented. I think, like anything else, it requires a bit of effort to learn (not a lot, though). Once you do, it's pretty easy to use. I've seen many non-technical people learn enough to write one-off queries for their own purposes, which I think is a testament to its simplicity.
Oneliners are simple I give that to you, but then you have those incomplete tables and whatnot. Like take all entries from A and join B on A.id and B.id, set the result to some default if B doesn't exist.
You are surely going to whip up a perfect string of SQL but I'd struggle.
Heh yeah that's pretty straightforward:
This will produce at least 1 row for every row in
a, and ifa.iddoesn't match anyb.id, the value ofb_resultwill be'some_default_val'.Not sure if that's exactly what you were describing (since it was a little ambiguous), but that's how I interpreted it.
Ultimately it's just a matter of investing a little time to learn it. It's not fundamentally difficult or complex, even though you certainly can write very complex queries.
You make me think of that xkcd with two mineral experts, wildly overestimate what ordinary people know about their speciality 😅
I have to do something like that sql like once every 2 years, so I tend to not invest enough, and then forget how it works. Give it some iterations and maybe I'll be OK one day!
Thanks for the solution!
Edit only found the meme template:
So you have to insert yourself: SQL, database specialist, SELECT, JOINS, COALESCE
collapsed inline media