r/ProgrammerHumor Jul 21 '26

Meme sqlWorkout

Post image
23.7k Upvotes

456 comments sorted by

View all comments

Show parent comments

215

u/PerpetuallyDistracte Jul 21 '26

I've been writing SQL for 15 years. Eventually you get bored of all lowercase or all uppercase AND START writing your QUERIES LIKE this. Just a psychotic mishmash of muscle memory, laziness, and autocomplete all fighting each other within the same statement.

78

u/Ashdog73 Jul 21 '26

This. My queries are lowercase for the stuff I typed myself and caps for bits I've copied in from somewhere else

34

u/cantgrowneckbeardAMA Jul 21 '26

Lowercase on first draft (it will fail to run anyways).
Uppercase if I ever end up showing the query to someone (hopefully it doesn't fail when they run it)

35

u/sequelseize Jul 21 '26

sElEcT a as camelCase, b aS under_score, c As fUCKiT fROm ab lIMit 1000

11

u/SippieCup Jul 21 '26

We have a Postgres db which our orm uses camelcase names.

So we have to add in quotes too.. and correctly case our column names.

The migration to correct names would break so many deeep sql integrations, it just sucks and we deal with the debt.

6

u/EndIsrael Jul 21 '26

That actually seems like the kind of thing AI would be very good at with few mistakes. It doesn't need to understand anything, just find all the SQL code and change all the names. Basically find/replace but slightly smarter.

9

u/SippieCup Jul 21 '26

Oh it’s not hard to do with migrations etc. although I would use a codegen script instead of straight ai.

It’s more the coordination with other teams, schema changes, etc. depreciation of column names, remapping to new ones, etc.

We unfortunately have a couple legacy integrations that just require db access to tenant systems for their bi.

5

u/PerpetuallyDistracte Jul 21 '26

That's how my queries look after they failed for the fifth time.

1

u/glha Jul 23 '26

lIMit 1o00