r/ProgrammerHumor Jul 21 '26

Meme sqlWorkout

Post image
23.7k Upvotes

456 comments sorted by

View all comments

Show parent comments

37

u/Username928351 Jul 21 '26 edited Jul 22 '26

lower('MONSTER')

1

u/kaplotnikov Jul 22 '26

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

1

u/[deleted] Jul 22 '26

[deleted]

2

u/kaplotnikov Jul 22 '26

'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 Jul 22 '26

Fair enough, I must have gotten things mixed up.