Hacker News new | ask | show | jobs
by somurzakov 2025 days ago
sql is not a code, like c#, you dont debug it, you inspect results, or inspect execution plan/traces.

how would you debug HTML, for example? Open it in browser, right? same for sql: run it and see if it works as you wanted

same goes for composability: you can compose SQL same way you can compose HTML, but you still need to understand the big picture

explicit control flow in SQL (cursors, for loops and stuff) is absolutely an antipattern. You need to think in terms of relational algebra and functional programming in order to write clean SQL