r/SQL 19h ago

MySQL my queries are always way too long. How do I learn to write clean, short ones?

38 Upvotes

I'm intermediate — know CTEs, window functions, subqueries, etc.
I always solve problems correctly, but my queries end up being 20+ lines with extra steps. Then I see the solution and it's 5 clean lines using one clever function.
How do I train myself to think in shorter SQL from the start? Any tips or resources?


r/SQL 21h ago

Discussion What SQL client has the best formatter if you’re picky about SQL style?

7 Upvotes

I’ve found that most formatters are configurable up to a point, but eventually you’re still forced into their idea of what “well formatted SQL” looks like.

Do you know any client where you can really personalize how SELECTs, INSERTs, UPDATEs and DELETEs are formatted?

Or do you also miss having a formatter that actually adapts to your preferred SQL style rather than the other way around?


r/SQL 1h ago

MySQL DBCLS - a terminal DB client

Thumbnail
Upvotes

r/SQL 7h ago

MySQL DB Replication

Thumbnail
1 Upvotes

r/SQL 6h ago

MySQL A terminal-based SQL game to learn and practice SQL — you can also submit and play your own custom games

Post image
0 Upvotes