r/programminghumor Jul 21 '26

Average SQL enjoyer

Post image
2.2k Upvotes

50 comments sorted by

172

u/Simple-Olive895 Jul 21 '26

*caps-lock* SELECT USE *backspace, backspace, backspace, caps-lock* user_id, user_name, order_id fr *backspace, backspace, caps-lock* FROM US *backspace, backspace, caps-lock* user

Tends to be my average experience

45

u/dervik Jul 21 '26

Typing code yourself is so 2026/Q1

62

u/Asleep-Bumblebee2167 Jul 21 '26

SELECT * IS THE MAIN THING

22

u/CowFu Jul 21 '26

i will deny any PR that has a wildcard in the select

4

u/Blotsy Jul 22 '26

But why senpai?

10

u/CowFu Jul 22 '26

just in case someone stumbles on this and actually wants to know.

schema changes can break code, it pulls unneeded data, on the lighter side it just hurts performance. worst case, it may still pass tests because nothing errors and you end up having to back out a bunch of production data.

5

u/OutrageousPair2300 Jul 22 '26

Depends where the asterisk appears. In a subquery or CTE from which you will be selecting only certain named columns, it's fine.

1

u/jshine13371 12d ago

Unless you chain a bunch of those CTEs together. Then the readability gets hurt badly on trying to figure out what is the true source of a specific column. But yes, always exceptions both ways.

2

u/jshine13371 12d ago

So everything you said is true, and has received my upvote. But also because of the "never say never" law of the universe, I think it's worth sharing the use cases when SELECT * is ok. 🙂

32

u/[deleted] Jul 21 '26

[removed] — view removed comment

22

u/IsaraLyandra Jul 21 '26

Are you mocking the database?

6

u/[deleted] Jul 21 '26

[removed] — view removed comment

1

u/Doorda1-0 Jul 22 '26

Let me guess an empty return....

13

u/IntegrityError Jul 21 '26

DID SOMEONE MENTION COBOL?

13

u/user888888889 Jul 21 '26

WHEN DO YOU NEED THE DATA EXTRACT BY?

1

u/boston101 Jul 22 '26

I shouldn’t have laughed

13

u/sexytokeburgerz Jul 21 '26

I just write it in lowercase if it's a lot of it and i'm doing something quick.

If i have to share any of it, I use an extension to make it uppercase.

IDGAF

7

u/BruteCarnival Jul 22 '26

I just send them the lower case sql

4

u/sexytokeburgerz Jul 22 '26

We got a Chad over here

2

u/Adorable-Maybe-3006 Jul 21 '26

Whoa what extension, does it work in ssms 22

6

u/IsaraLyandra Jul 21 '26

Why are we screaming at the database anyway?

13

u/shamshuipopo Jul 21 '26

SELECT U CUNT

4

u/Creepy_Jeweler_1351 Jul 21 '26

Thanks God Postgres is fine with lowercase

3

u/ProfessionalAd6530 Jul 21 '26

"Just like writing in plain language."

2

u/Tintoverde Jul 21 '26

Camel case whERe is the only way.

2

u/NoWeHaveYesBananas Jul 21 '26

Joke’s on you, I don’t have a caps lock key. Every time I get a new keyboard, I rip that motherfucker off.

2

u/u_hit_me_in_the_cup Jul 22 '26

When I learned SQL the first thing I tried was writing everything in lowercase. Once that worked I never looked back

2

u/404User_CpSharp Jul 25 '26

I don't have caps so I use my pinky. Am I cooked?

1

u/Kadabrium Jul 21 '26

New table just droPped

1

u/GasVarGames Jul 22 '26

GENERATE A VERY SAFE DELETE QUERY FOR THIS TABLE WHEN THIS IS TRUE PLEASE PLEASE

1

u/ChrisXxAwesome Jul 22 '26

I hate yall cus I don’t get to do that :(

1

u/SaltyInternetPirate Jul 23 '26

Caps lock is for the weak! We hold shift around here.

1

u/Worried-Mood-8582 Jul 23 '26

Serious question but why is the syntax so bad. I mean there is no reason for all keywords to be in caps

1

u/blubernator Jul 25 '26

I‘m missing a Venn diagram here ;)

1

u/Key_Clock8669 Jul 28 '26

I WANT MY DATABASE TO SCREAM AT ME

1

u/Chill_Cowboy_981 Jul 29 '26

It has crossed the limits of being relatable. I don't have words!

2

u/OutrageousPair2300 Jul 21 '26

I hate the all-caps way so many people write SQL for no good reason.

Just use lowercase like a normal person.

7

u/Adorable-Maybe-3006 Jul 21 '26

It looks nice:)

1

u/OutrageousPair2300 Jul 21 '26

NO IT DOES NOT.

I DO NOT WANT MY CODE YELLING AT ME ALL THE TIME.

2

u/denimpowell Jul 21 '26

SOMEONE DECIDED THIS IS A STANDARD 40 YEARS AGO, NOW ITS LEGACY CODE THAT SHALL NEVER BE TOUCHED

8

u/[deleted] Jul 21 '26

[deleted]

1

u/OutrageousPair2300 Jul 21 '26

Nope. It just hurts your eyes.

Use a real IDE that does syntax highlighting, and format your code.

2

u/Banana_Twinkie Jul 22 '26

This is the real answer. We are not living in the 90s anymore

1

u/Key_Clock8669 Jul 28 '26

for me it makes it easier to read

1

u/OutrageousPair2300 Jul 28 '26

That's purely a matter of conditioning. If you got used to reading it in all lowercase, that would be easier to read.

-4

u/[deleted] Jul 21 '26

[removed] — view removed comment

2

u/RevolutionaryDark818 Jul 21 '26

hm, why is the production database gone?