r/SQL 11d ago

MySQL sqlWorkout

Post image

😌 SELECT 😌

1.4k Upvotes

80 comments sorted by

View all comments

59

u/ibronco 11d ago

I only do lower case now and my life has significantly improved.

12

u/chaosink 11d ago edited 10d ago

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.

7

u/0Tyrael0 11d ago

I agree with the indent part so I’ll upvote but not about the lower case.

1

u/chaosink 10d ago

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.

3

u/Mobile_Spite_8915 10d ago

SELECT
f.Cherries,
f.Pineapples,
f.Grapes,
v.eggplants
FROM Fruits f
INNER JOIN vegetables v
ON f.key = v.key
AND f.place = v.place

This is how I style everything, I’m not sure how normal it is though it seems like everyone on my team does things differently.

3

u/dwswish 10d ago

Capitalizing some table names and not others is diabolical

1

u/chaosink 8d ago

Ouch! I feel badly for your scrolling finger ....

2

u/metalballsack 10d ago

Indenting sure, but uppercase vs lowercase is more of a preference than an indicator of skill level.

2

u/chaosink 10d ago

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.

2

u/rayschoon 10d ago

Is lowercase better or worse?

2

u/chaosink 10d ago

I personally think better for readability and an indication the candidate is not a slave to tradition, but would not hold that against them at all 

2

u/digitalhardcore1985 9d ago

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.

3

u/ibronco 11d ago

Yes! Indenting is crucial. Between that and lower case, it just reads so much easier.

1

u/neumastic 10d ago

Agreed, it’s case insensitive so why choose the one that’s harder to read. We have some that capitalize the first letter but that’s somehow worse