Skip to content
DevMeme
2720 of 7590
Databases Post #3005 · source on Telegram

The Irrational Fear of Lowercase SQL

Description

This image is a screenshot of a conversation on Twitter, initiated by the official account for Supabase (@supabase_io). The first tweet, posted on April 20, 2021, asks the developer community: 'Do you write SQL in uppercase or lowercase? Why do you prefer to do it that way?'. Below it is a reply from a user named 'nooral network' (@kd29598), whose profile picture is an anime character. The reply humorously confesses, 'UPPERCASE, for some reason i am scared of writing SQL in lowercase'. This meme captures a long-standing, semi-serious debate within the programming world. While most SQL databases are case-insensitive regarding keywords, a strong convention exists to write commands like 'SELECT', 'FROM', and 'WHERE' in all caps for readability, to distinguish them from table and column names. The joke lies in the user's dramatic and irrational 'fear' of deviating from this norm, a feeling that resonates with many senior developers who have had this stylistic choice ingrained in them since they first learned the language, making the alternative feel fundamentally wrong

Comments

30
Anonymous ★ Top Pick I write my SQL keywords in uppercase for the same reason I use `sudo` - I need the database to know I'm not making a request, I'm issuing a command
  1. Anonymous ★ Top Pick

    I write my SQL keywords in uppercase for the same reason I use `sudo` - I need the database to know I'm not making a request, I'm issuing a command

  2. Anonymous

    I write SQL in ALL CAPS so that when EXPLAIN ANALYZE exposes a seq-scan on the 2 TB table, at least the query is shouting in panic with me

  3. Anonymous

    The real fear isn't writing SQL in lowercase - it's explaining to the DBA why your 'select * from users where 1=1' query brought down production because you thought case sensitivity only mattered in the WHERE clause, not in your career trajectory

  4. Anonymous

    The fear of lowercase SQL is real - it's like we've been conditioned by decades of O'Reilly books and Stack Overflow answers to believe that `SELECT * FROM users WHERE id = 1` will somehow execute differently than `select * from users where id = 1`. Spoiler: the query optimizer doesn't care about your existential dread over case sensitivity, but your code reviewer with 20 years of Oracle experience absolutely does

  5. Anonymous

    I uppercase SQL so I can yell at the database without paging SRE - and to avoid Oracle-to-Postgres migrations that create both Users and users when someone quotes an identifier

  6. Anonymous

    UPPERCASE for keywords - lowercase is harmless until someone quotes identifiers; then Oracle folds up, Postgres folds down, and your ORM folds the team

  7. Anonymous

    UPPERCASE SQL keywords: the only highlighter that survives a DBA's 20-year-old query dump without mercy-kill

  8. @Roman_Millen 5y

    Keywords in lowercase, table/column names in uppercase — that's what I prefer.

    1. @prkiso 5y

      select KITTENS from ANIMALS where no this is just wrong

      1. @Roman_Millen 5y

        It might look scary but it's actually helpful for reading the queries in case you don't have a syntax highlight.

        1. @prkiso 5y

          SQL is scary anyway. I feel like I'm gonna drop the table and not know

          1. @Roman_Millen 5y

            Good thing that SQL queries are often used not directly in sources or DBMS workbench, but in a special console where you can't do anything but "select".

            1. Сифуд Кстолу 5y

              or "DROP"

    2. Сифуд Кстолу 5y

      +1

  9. @Roman_Millen 5y

    KITTENS column in ANIMALS table — now this on the other hand is scary 😢

    1. @prkiso 5y

      Yes it's a zoo with animals for columns and enclosures for rows

  10. @mynameahdeez 5y

    DROP DATABASE *

  11. @dellism1 5y

    for some reasons database works better if you shout at it

    1. @Ra_zor 5y

      Well, that's some serious tech, you convinced me

  12. @AmyCupcake 5y

    SELECT ROMEO FROM ART WHERE FORE

  13. @ProAbdulrahman 5y

    lowercase, because it is easy to read

  14. @ErinIlya 5y

    комменчу на русском, я у мамы опасный

    1. dev_meme 5y

      english only please! warning 1/3 for @ErinIlya

  15. @ErinIlya 5y

    commenchy na russskom

    1. dev_meme 5y

      still not english. don't test me, comrade. warning 2/3 for @ErinIlya

    2. Deleted Account 5y

      hahaha, "commentator"

  16. @ErinIlya 5y

    asd

    1. dev_meme 5y

      👀

    2. dev_meme 5y

      *sad, I assume

  17. @Roman_Millen 5y

    Whatever. As long as keywords and names differ. It also depends on what config is used for DBMS. For the DB I used not so long ago writing names in caps was the only option.

Use J and K for navigation