r/SQL • • Oct 01 '26

Discussion Does anyone else just leave caps on when naming your variables ?

I might just be lazy but I feel like it saves me effort.

13 Upvotes

31 comments sorted by

41

u/Eleventhousand Oct 01 '26

I held down shift every time for about the first twenty years.

Since then, I'm fine with just using lowercase for everything.

6

u/gumnos Oct 01 '26

adding another vote in this camp. If it's a query that is big and confusing and other folks will read it, I might go back and uppercase my keywords, but for the most part, everything is just lowercase and I'm fine with that after 25+ years of coding (though I became fine with it about 10yr into my career 😆).

8

u/wittgenstein1312 Oct 01 '26

All caps is a relic of a time before modern code editors. With syntax highlighting, all lowercase SQL is considerably easier to read imo

2

u/Zoidburger_ Oct 02 '26

I used to be pretty particular about capitalization. Caps on keywords, functions, proper capitalization to match table and schema names, etc.

Joined a new team whose syntax policy was "do not capitalize anything except for literals." Took a sec to get used to but since then, I've never looked back. Lowercase SQL feels more relaxing lol

1

u/imtheorangeycenter Oct 02 '26

Anything capitalised in code reads in my head like a weird stress/imperitivness.

SELECT (damn you man, get it!) apples (ok), PEARS (don't forget these!)

Therefore I could live with:

"JOIN SALES" being an inner join "join sales" being a left outer.

Of course that would be madness. 

20

u/serverhorror Oct 01 '26

I write everything in lower case. Our formatter/linter takes care of things.

I'm not wasting brain cycles on that ...

3

u/44Nj Oct 02 '26

Do you know if this is a default feature of Sam's or visual studio?

2

u/serverhorror Oct 02 '26

We have it as a pre commit hook and in CI.

1

u/Runehalfdan Oct 02 '26

Which formatter/linter?

11

u/Aggressive_Ad_5454 Oct 01 '26

I use caps for keywords and lowercase for identifiers. Why? MySql that needs to run on Windows and also on case sensitive OSs.

1

u/Guilty-Property Oct 02 '26

Everything is lower case otherwise our linter rejects it

0

u/Holiday-Tip-3720 Oct 02 '26

this is the only way

7

u/TechKNITian Oct 01 '26

My keyboard has the Caps Key set to one word then turns off when I hit space.

2

u/techforallseasons Oct 02 '26

that is nifty!

4

u/alegendmrwayne Oct 01 '26

Gods I tried to stick to uppercase keywords for the longest time. But now I’ve quite happily settled into lowercase keywords, PascalCase tables, columns and camelCase vars. usp_, ufn_ and vw_ prefixed stored procs, functions and views

Life is so much easier now

1

u/imtheorangeycenter Oct 02 '26

I remember being (self)taught/picked up to start sprocs with usp_rather than sp_ because it then doesn't also search master for it in addition to your current database in SQL Server.

I question this twenty years later, but it stuck and seems feasible.

7

u/ApresMoi_TheFlood Oct 01 '26

All lowercase everything. I can’t be bothered to work my pinky by pressing shift or caps lock.

3

u/Pearlsnap Oct 01 '26

Lowercase and tabbing thru SQL prompt like an adult.

3

u/RandomiseUsr0 Oct 01 '26 • Bravo

ARE YOU EVIL?

6

u/Similar_Command7256 Oct 01 '26

lowercase on everything. our brains read and process it much easier than caps.

2

u/OO_Ben Postgres - Retail Analytics Oct 01 '26

All lowercase with very good formatting. Formatting does way more than upper case in my opinion in terms of readability

2

u/Infini-Bus Oct 01 '26

I just do all lowercase and then use autoformat.

2

u/NullVal Oct 01 '26

Yes everything is uppercase, because it feels like I get to yell at the computer through the code :)

2

u/bishnabob Oct 02 '26

Upper case is very shouty, and I have enough of that with the kids.

3

u/Zestyclose-Turn-3576 Oct 01 '26

The whole uppercase keyword thing is like a bizarre fetish. A completely pointless ritual, from the days when people erroneously thought it improved the chances of an exact match on SQL making parsing more efficient, and made entirely obsolete by colour coded syntax highlighting, if you like that sort of thing. Even Fortran doesn't do it any more https://stdlib.fortran-lang.org/page/contributing/StyleGuide.html

To be gracious though, I'll grudgingly accept one downvote for every rational reason for doing it in 2026.

3

u/imtheorangeycenter Oct 02 '26

SecOps say embiggening the font is a peeping-eyes security risk, and I'm getting older and finding it hard to read without the capitalisation.

I joke. Apart from getting older.

1

u/NeoChrisOmega Oct 01 '26

I like to hold down the shift key. It makes more sense to me because I also use underscores which requires the shift key anyhow. 

When typing normally, I also have the same habit, because it feels more impactful when I have to hold down the key to emphasize the word

1

u/givibeg Oct 01 '26

I use lowercase and SQL formatter.

1

u/mlhigg1973 Oct 01 '26

Everything’s in lower case, except where I comment out important notes throughout

1

u/ADubiousDude Oct 02 '26

😱

I don't even know you anymore. Who hurt you? Where did it all go wrong?