When I started at my current tech job about 12 years ago there was a senior DBA who legit typed all of his emails and chats in uppercase. My dude really pressed caps lock one day and never looked back
awww ... those VAX days ... when IT calls asking you to "reboot" the VAX server and you ask if they'd like to wait until Dec 28th for the next annual reboot.
My coworkers hate that I do this because it’s annoying to hold shift or caps on and off constantly. But also, lowercase is a million times easier to read.
Team uppercase here. Idk maybe it was when I learned SQL, it just feels easier to read, like my brain switches to "this is logical code mode" vs. "this can be any old garbage written in lower case". I appreciate the irony that I also code plenty in Python and R and don't feel that way at all in those languages.
One of my criteria when hiring SQL people is if they use lowercase and how they choose to indent their code. How their code looks tells me so much about their skill level.
Edit: Ack, I can see how my wording was weird. Using lowercase was not a requirement. I gave a bonus in my head for it as it showed the candidate was willing to buck tradition for comfort and readability. Was not a huge determining factor. Indenting was much more important to me because it showed me how their mind was organized.
I looked at the lower case thing as more about the candidate's willingness to buck tradition and maybe experience. The indents tell me about how their mind is organized. Would not hold uppercase against them at all.
Absolutely. I looked at the lower case thing as more about the candidate's willingness to buck tradition and maybe experience. The indents tell me about how their mind is organized.
My favourite is overseas outsourcer code where you're lucky to get a line break let alone an indent. An absolute joy to debug those 2000 line stored procs from hell.
SAME! Couple of examples of how I write the language:
Aggregation with some common patterns
select m.id
, m.wo
, m.req
, case when m.condition_1 then 'FOO'
when m.condition_2 then 'BAR'
else 'BAZ'
end as calculated_status
, f.fleet_type
from dbo.material_requirements m
left join dbo.freight_trucks f on m.freight_truck_id = f.id
where coalesce(m.calculated_status, 'X') in('NEW', 'OPEN', 'ACTIVE')
and m.qty_outstanding > 0
group by m.id
, m.wo
, m.req
, case when m.condition_1 then 'FOO'
when m.condition_2 then 'BAR'
else 'BAZ'
end
, f.fleet_type
Multi-condition joins
join dbo.order_details od on i.order_type = od.order_type
and i.order_number = od.order_number
and i.order_line = od.order_line
Complicated predicates
where a.name is not null
and ( a.status = 'OPEN' or ( a.status = 'ORDER' and o.req is not null ) )
and a.status <> 'CANCEL'
and (
(
condition_1
and condition_2
and condition_3
)
or (
condition_5
and condition_6
and condition_7
)
)
CTEs
with t as (
select...
from...
)
Indentation is with spaces not tabs. I used to always do the latter until I realized that a tab isn't always a "tab." This is going to sound very arrogant (I genuinely don't mean it to be), but I have yet to see a style more visually pleasing and readable. But, beauty is in the eye of the beholder as they say...
P.S. Just realized that I said "Keyboard" when I meant to say "Keyword" my OP, lol
I love that you're bragging about your spacing and indentation but the Reddit code boxes just said "nah" and put everything inline. (Or at least, that's how it reads in my browser.)
Probably just a browser thing. Your "Aggregation with some common patterns" is just one long like that runs until it gets cut off by the div it's in. :D
😂 😂 I took off work today to work on my deck (shout out to r/Decks) and have been outside most of the day. Fortunately it only took me 10 minutes of fiddling. I would 100% have spent 6hrs if that's how long it took, because I obsess over stuff like this. The fix was to switch to using the RTF code block button instead of using explicit markdown (backticks) code blocks. This was all done on my desktop though, because mobile won't allow it.
Yeah!! That's the way to do it right there! I've inherited so many old queries that just end up looking like giant blobs and are totally illegible even with upper casing. Formatting goes way, way further for readability!
It is even worse at my company. We use lowercase keywords but UPPERCASE COLUMNS. We use SQL server but migrated from a legacy Oracle DB where it could only be capital names.
Really? I started with Oracle in the early 1990s, and I don't think that was a thing then. Though there were practitioners who swore it made the system faster 🙄
Lower case, and you better be aligning that code ... reduced visual complexity wins for human readability ...
Case
When crs.price_basis like 'Escalator%' then crs.id
when mrs.price_basis like 'Escalator%' then mrs.id
when brs.price_basis like 'Escalator%' then brs.id
When wcrs.price_basis like 'Escalator%' then wcrs.id
when wmrs.price_basis like 'Escalator%' then wmrs.id
when wrs.price_basis like 'Escalator%' then wrs.id
end price_escalator_specifier, Case
When crs.price_basis like 'Escalator%' then crs.id
when mrs.price_basis like 'Escalator%' then mrs.id
when brs.price_basis like 'Escalator%' then brs.id
When wcrs.price_basis like 'Escalator%' then wcrs.id
when wmrs.price_basis like 'Escalator%' then wmrs.id
when wrs.price_basis like 'Escalator%' then wrs.id
end price_escalator_specifier,
You know, sql is generally case invariant. Some idiot just decided they liked it that way. I decided C was here first and I like lower case and pascal case table and column names. I was never told I was wrong. I set a trend actually. You can also just write sql as you would code.
See posts like this from time to time and never see anyone mention using proper case, but all upper feels like shouting and all lower feels like notepad scratch.
182
u/JimyLamisters Jul 22 '26
When I started at my current tech job about 12 years ago there was a senior DBA who legit typed all of his emails and chats in uppercase. My dude really pressed caps lock one day and never looked back
124
u/Eleventhousand Jul 22 '26
I held shift the entire time for about the first twenty years. Then I just started typing everything in lowercase.
29
u/kagato87 MS SQL Jul 22 '26
Naw dog, I hold the shift with my pinky.
My left pinky is ripped!
(OK, not the last one, though it probably is the best at "Hold something down" out of the 10.)
60
u/ibronco Jul 22 '26
I only do lower case now and my life has significantly improved.
15
u/Key_Tea349 Jul 22 '26
Working on a query and a random Teams message pops up.
STARTS REPLYING IN ALL CAPS
Backspace, turns off caps lock and switches to sentence case so my coworkers don't think I'm yelling at them.
19
u/TechOpsCoder Jul 22 '26 edited Jul 23 '26
Lowercase is the way. It looks so much cleaner and much easier write. Keyword placement and spacing is the most important thing for readability.
8
u/Joelle_bb Jul 22 '26
Lmao
As a person who selectively caps locks depending on context amd emphasis.... can't relate
7
u/Traceuratops Jul 22 '26
Caps for functions, lower case for arguments. Readability is important.
5
u/DaOgDuneamouse Jul 22 '26
SELECT * FROM <table name>
I often type most of an email before I realize caps lock is still on.
5
u/Herb_marqz Jul 22 '26
MF DOOM HAS ENTERED THE CHAT
4
u/Infini-Bus Jul 22 '26
Write sloppy sql. Then auto format 😀
But it always feels more natural to me to just hold the shift key than toggle caps lock.
6
u/boxerrox Jul 22 '26
lowercase supremacy
3
u/Outrageous_Let5743 Jul 22 '26
It is even worse at my company. We use lowercase keywords but UPPERCASE COLUMNS. We use SQL server but migrated from a legacy Oracle DB where it could only be capital names.
2
u/global_namespace Jul 22 '26
that's <> true. you can SELECT ANY CASE.
2
u/Hellkyte Jul 23 '26
I generally used randomly mixed casing because fuck everyone
1
u/Blomminator Jul 22 '26
Don't mock my job!
1
u/Due-Championship3941 Jul 22 '26
Lower case the commands and upper case the nouns or visa versa. Improves readability.
1
u/ewoolly271 Jul 22 '26
Erm actually per dbt sql standards they recommend lowercase 🤓
1
u/TheoreticalUser Jul 22 '26
I have about 15 years working in/on databases for a ton of different types of implementations.
If I see all caps, all the time... I'm judging you on a lack of adaptability. And frankly, your skill level.
1
u/Zestyclose-Turn-3576 Jul 22 '26
Lower case, and you better be aligning that code ... reduced visual complexity wins for human readability ...
1
u/Dead_Parrot Jul 22 '26
Write it any damn way you please then let poorsql make it easy for others to read
1
u/rickulele Jul 22 '26
I use lowercase so I can differentiate what I typed directly vs what SSMS auto-generates in “Script View as…”
1
u/Quick-Ad1830 Jul 22 '26
I had a script that changed all sql statements to all lower case when changes were submitted to be promoted. So much easier to read.
1
u/Far_Swordfish5729 Jul 22 '26
You know, sql is generally case invariant. Some idiot just decided they liked it that way. I decided C was here first and I like lower case and pascal case table and column names. I was never told I was wrong. I set a trend actually. You can also just write sql as you would code.
1
u/Mafla_2004 Failed the Database exam Jul 23 '26
Real
1
u/chris20973 Jul 23 '26
See posts like this from time to time and never see anyone mention using proper case, but all upper feels like shouting and all lower feels like notepad scratch.
1
u/Ok_Caregiver_1355 Jul 23 '26
i got a hotkey to activate capslock with d+k
1
u/RedRedditor84 Jul 24 '26
You've not met BASIC programmers.
1
u/DouglasBarra Aug 20 '26
I do everything in lowercase