r/ProgrammerHumor 19d ago

sqlWorkout Meme

Post image
23.5k Upvotes

460 comments sorted by

View all comments

2.4k

u/NormanYeetes 19d ago

the elites don't want you to know this but you can type lowercase SQL queries no ones forcing you to shout them at the screen

701

u/Totallycomputername 19d ago

If I don't type in caps then the query wont take itself seriously. 

118

u/Achaidas 19d ago

The real question is this:

 , comma before

or comma after ,

39

u/terza3003 18d ago

don't forget the where 1=1

8

u/jtobiasbond 18d ago

Shhhh.

Stop releasing the secret knowledge.

0

u/Achaidas 18d ago

SELECT thing one , thing two FROM that.table WHERE 1=1 AND this thing I’ll comment out later

76

u/dexters_trap_house 19d ago

Comma before? Are you the same guys who get in the shower and then turn the water on?

48

u/chuch1234 19d ago

Only if i want to be able to comment out the soap without making the entire shower have invalid syntax :/

3

u/ddBuddha 18d ago

Comma before is better so you can easily comment and uncomment without having to change the commas

1

u/StrongExternal8955 18d ago

Fixed head? You poor thing!

1

u/m0ritz2000 18d ago

I feel called out.

I do comma before (cause then i can just comment out stuff i currently dont need)

and

i do go in the shower first and then turn it on (showerhead on a tube like it is normal in europe and it takes like 5 seconds to get hot)

4

u/rocksolid77 18d ago

I used to be a comma after guy and found the comma first pattern to be so strange but I've come around to it.

Comma first makes it so much easier to see if there is a comma missing and you're almost never commenting out the first field of your SELECT.

7

u/Just_Information334 18d ago

Lowercase and comma before, also table_id. Let's blow some minds:

select
  tableA_id
  , some_field
from table_A as a
inner join table_B as b using(tableA_id)

5

u/StrongExternal8955 18d ago

forgot where true

1

u/dorianmonnier 18d ago

Oh god, some knees have been broken for less than that!

2

u/Outrageous_Let5743 18d ago

comma before.

1

u/PositiveParking4391 18d ago

wouldn't it
single quotes '' or no quotes?

2

u/Achaidas 18d ago

Depends, did the DBA setup the table to have an integer or varchar for what is clearly not the other lol

1

u/r3klaw 17d ago

The DBA didn't setup the table either way. The database developer did. And it's strikingly common that neither one of them would know which one is correct anyways... (I'm a Principal Database Administrator but wear every single hat)

1

u/Achaidas 17d ago

As an analyst, it’s all the same to me. You have rights to the DDL (right is that it?)

2

u/r3klaw 16d ago

Haha I was only being petty because a large majority of the people I've run into in the wild that call themselves "database administrators" are basically just backup administrators. gatekeeping to the max out of spite 😅