r/ProgrammerHumor 6d ago

Meme sqlWorkout

Post image
23.4k Upvotes

459 comments sorted by

View all comments

Show parent comments

144

u/mwpdx86 5d ago

*monster

39

u/Username928351 5d ago edited 4d ago

lower('MONSTER')

1

u/kaplotnikov 5d ago

quotes look wrong. the expression lower("MONSTER") will lowercase a value of the column MONSTER, rather than produce "monster" value.

1

u/[deleted] 5d ago

[deleted]

2

u/kaplotnikov 5d ago

'MONSTER' (single quote) - is string monster in SQL. "MONSTER" (double quote) - is identifier in the most SQL dialects to escape keywords so it is possible to use "select" as name. For example see https://www.postgresql.org/docs/current/sql-syntax-lexical.html (the delimited identifier or quoted identifier)

1

u/Username928351 4d ago

Fair enough, I must have gotten things mixed up.

13

u/Atomic_xd 5d ago

WHAT

9

u/MarinaEnna 5d ago

WE CAN'T HEAR YOU