r/SQL 9h ago

MySQL sqlWorkout

Post image

😌 SELECT 😌

640 Upvotes

43 comments sorted by

102

u/JimyLamisters 8h ago

When I started at my current tech job about 12 years ago there was a senior DBA who legit typed all of his emails and chats in uppercase. My dude really pressed caps lock one day and never looked back

32

u/fullyonline 8h ago

My dude really pressed caps lock one day and never loocked back

Fixed it for you.

14

u/vj2018 6h ago

LEGEND SAYS IT IS STILL LOCKED TO THIS DAY

7

u/EdgeSimilar1726 6h ago

THIS GOT A HEARTY CHUCKLE OUT OF ME

1

u/DangerMacAwesome 36m ago

I AM YELLING, CARL

85

u/Eleventhousand 9h ago

I held shift the entire time for about the first twenty years. Then I just started typing everything in lowercase.

24

u/KlausInTheHaus 9h ago

Your left pinky must have been an absolute python.

12

u/Eleventhousand 9h ago

Now that you mention it, it does look 4% thiccer than my right.

13

u/snafe_ PG Data Analyst 8h ago

Moment of silence for the right shift key, always forgotten.

3

u/JackTheKing 5h ago

TIL there is a shift key on the right

. . . and command and option too?!

1

u/Sengfroid 7h ago

Genuinely set mine for macros.

And then forget even the macros on it because that's how little the key is used

3

u/Mutopiano 9h ago

Absolute SQL*

8

u/government_ 8h ago

My coworkers hate that I do this because it’s annoying to hold shift or caps on and off constantly. But also, lowercase is a million times easier to read.

6

u/hopefullyhelpfulplz 7h ago

I do it in random upper/lowrcase segments cus why not

3

u/Eleventhousand 7h ago

You are the most enlightened

3

u/hopefullyhelpfulplz 7h ago

Tis I! The EnLIghteNEd OnE

2

u/jib_reddit 6h ago

I used to write it in lowercase but recently started using upper as I like the "shoutieness" of it.

16

u/kagato87 MS SQL 8h ago

Naw dog, I hold the shift with my pinky.

My left pinky is ripped!

(OK, not the last one, though it probably is the best at "Hold something down" out of the 10.)

32

u/ibronco 8h ago

I only do lower case now and my life has significantly improved.

2

u/chaosink 2h ago

One of my criteria when hiring SQL people is if they use lowercase and how they choose to indent their code. How their code looks tells me so much about their skill level.

3

u/ibronco 2h ago

Yes! Indenting is crucial. Between that and lower case, it just reads so much easier.

9

u/Joelle_bb 8h ago

Lmao

As a person who selectively caps locks depending on context amd emphasis.... can't relate

8

u/Key_Tea349 7h ago

Working on a query and a random Teams message pops up.

STARTS REPLYING IN ALL CAPS

Backspace, turns off caps lock and switches to sentence case so my coworkers don't think I'm yelling at them.

5

u/DaOgDuneamouse 7h ago

SELECT * FROM <table name>

I often type most of an email before I realize caps lock is still on.

8

u/TechOpsCoder 7h ago

Lowercase is the way. It looks so much cleaner and much easier write. Keyboard placement and spacing is the most important thing for readability.

3

u/Traceuratops 5h ago

Caps for functions, lower case for arguments. Readability is important.

1

u/Zestyclose-Turn-3576 3h ago

modern editing environments use colours to differentiate between these anyway

2

u/global_namespace 7h ago

that's <> true. you can SELECT ANY CASE.

2

u/Outrageous_Let5743 6h ago

It is even worse at my company. We use lowercase keywords but UPPERCASE COLUMNS. We use SQL server but migrated from a legacy Oracle DB where it could only be capital names.

1

u/Zestyclose-Turn-3576 3h ago

Really? I started with Oracle in the early 1990s, and I don't think that was a thing then. Though there were practitioners who swore it made the system faster πŸ™„

2

u/Herb_marqz 5h ago

MF DOOM HAS ENTERED THE CHAT

2

u/Infini-Bus 3h ago

Write sloppy sql.Β  Then auto format πŸ˜€

But it always feels more natural to me to just hold the shift key than toggle caps lock.

2

u/boxerrox 1h ago

lowercase supremacy

1

u/Blomminator 8h ago

Don't mock my job!

1

u/Due-Championship3941 6h ago

Lower case the commands and upper case the nouns or visa versa. Improves readability.

1

u/ewoolly271 4h ago

Erm actually per dbt sql standards they recommend lowercase πŸ€“

1

u/TheoreticalUser 4h ago

I have about 15 years working in/on databases for a ton of different types of implementations.

If I see all caps, all the time... I'm judging you on a lack of adaptability. And frankly, your skill level.

1

u/Zestyclose-Turn-3576 2h ago

Lower case, and you better be aligning that code ... reduced visual complexity wins for human readability ...

      Case
        When crs.price_basis  like 'Escalator%' then crs.id
        when mrs.price_basis  like 'Escalator%' then mrs.id
        when brs.price_basis  like 'Escalator%' then brs.id
        When wcrs.price_basis like 'Escalator%' then wcrs.id
        when wmrs.price_basis like 'Escalator%' then wmrs.id
        when wrs.price_basis  like 'Escalator%' then wrs.id
      end price_escalator_specifier,      Case
        When crs.price_basis  like 'Escalator%' then crs.id
        when mrs.price_basis  like 'Escalator%' then mrs.id
        when brs.price_basis  like 'Escalator%' then brs.id
        When wcrs.price_basis like 'Escalator%' then wcrs.id
        when wmrs.price_basis like 'Escalator%' then wmrs.id
        when wrs.price_basis  like 'Escalator%' then wrs.id
      end price_escalator_specifier,

1

u/Dead_Parrot 2h ago

Write it any damn way you please then let poorsql make it easy for others to read

1

u/rickulele 2h ago

I use lowercase so I can differentiate what I typed directly vs what SSMS auto-generates in β€œScript View as…”

1

u/Quick-Ad1830 2h ago

I had a script that changed all sql statements to all lower case when changes were submitted to be promoted. So much easier to read.

1

u/Far_Swordfish5729 1h ago

You know, sql is generally case invariant. Some idiot just decided they liked it that way. I decided C was here first and I like lower case and pascal case table and column names. I was never told I was wrong. I set a trend actually. You can also just write sql as you would code.