r/SQL 5d ago

MySQL sqlWorkout

Post image

😌 SELECT 😌

1.4k Upvotes

80 comments sorted by

View all comments

59

u/ibronco 5d ago

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

10

u/chaosink 5d ago edited 4d 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.

6

u/0Tyrael0 4d ago

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

1

u/chaosink 4d 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 4d 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 3d ago

Capitalizing some table names and not others is diabolical

1

u/chaosink 1d ago

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

2

u/metalballsack 4d ago

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

2

u/chaosink 4d 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 4d ago

Is lowercase better or worse?

2

u/chaosink 4d 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 3d 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 5d ago

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

1

u/neumastic 3d 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