when I (and my team members) are writing SQL queries, we usually:
• Start with a vague idea of what we need to query and do some select *’s + reading column names to identify relevant tables & columns. Pain point: I can’t quickly visualize the “table-space” of the database. Imagine a bunch of linked spreadsheets in a spatially oriented way to highlight the relationships between tables.
• Start building up the query, run, iterate, add some joins. Pain point: no SQL tool encourages prototyping and iteration in a more data-oriented way. They all make you throw away the query you wrote and ran and the results table every time
• At this point, I usually understand the “final form” of my query. What I want the table of results to actually look like, and then I have to work backwards and figure out the intermediate joins to get there. Pain Point: I do this on pencil & paper or in a vector drawing tool, but ideally this is somewhat augmented by the latent knowledge in the database tables.
• Finally, I iterate on my long-ass SQL query until it feels right. Pain point: iteration is kinda painful, both the speed but also the fact that results are thrown away each time you run a query. Its hard to feel a sense of partial progress.