I admittedly have very little professional experience with SQL (just single table databases with SFW queries and inserts) but I’ve been learning more lately, and I find I strongly prefer writing it with lowercase keywords. It’s easier to type since I don’t have to keep pressing caps lock or holding down shift, and I don’t find uppercase keywords to be any more readable (but like I said, I don’t have much professional experience, and maybe it’s different at that level) largely due to the syntax highlighting that pretty much every editor of the last 20 years provides. The only reason I can think of for using uppercase keywords is if you’re working with a legacy codebase with existing SQL code that uses uppercase keywords.
It’s not really an argument per se, but one other point I’d make is that so many programming languages have been invented over the years and afaik pretty much none of them use (all) uppercase keywords, in fact the only mainstream language I can think of off the top of my head that does that is COBOL, which is older than SQL. Did the creators of all those languages make a mistake by using lowercase keywords?
Uppercase initially and then gradually start introducing lower case letters farther down the statement, in an effort to gaslight the guy who has to debug your code later
You’re a monster.
i don’t remember posting this at all
Queries can quickly get complex, and I find that using caps increases readability quite a bit.
Editing in something that does blocking and syntax highlighting helps a lot too
I use uppercase for keywords in my database console/script editor mostly because it helps me find the identifiers faster for figuring out where the parameters need to go once I port it to the server code. Very lo-fi way of coding but whatever
lowercase if I’m just typing ad hoc one off queries, but always uppercase if it’s something anyone will have to read later, including myself in six months
Lowercase because if I do uppercase I feel like a crusty old COBOL dude patching a 50 year old financial system.
I do lowercase, too lazy to switch casing for the commands and most editors do syntax highlighting for sql so I don’t think there’s really much readibility loss.
Generally if a gray beard does it I will as well. While I dont follow their advice blindly there is a reason why boomer programmers stick around in some spaces.
I write with whatever but then run pg_format on the file. Its defaults are probably what most SQL experts have come to a consensus on.
Upper. Just convention.
UPPER, because usually when I’m writing SQL it’s because I’m working on someone else’s code. Usually when it’s fresh code I abstract, so the actual DB used can change.
Uppercase keywords so you can actually read your code
just use the formatter and go with whatever it does
Honestly, whatever I feel like.
Lower case, easier to type and just run it through a formatter. And no implicit joins.
Better question: “Ess Queue Elle” , or “Sequel”?