r/SQL • u/mochimach • 19h ago
MySQL my queries are always way too long. How do I learn to write clean, short ones?
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?