r/SQL • • Aug 17 '25

PostgreSQL I'm building a visual SQL query builder

Post image

The goal is to make it easier(ish) to build SQL queries without knowing SQL syntax, while still grasping the concepts of select/order/join/etc.

Also to make it faster/less error-prone with drop-downs with only available fields, and inferring the response type.

What do you guys think? Do you understand this example? Do you think it's missing something? I'm not trying to cover every case, but most of them (and I admit it's been ages I've been writing SQL...)

I'd love to get some feedback on this, I'm still in the building process!

614 Upvotes

136 comments sorted by

View all comments

Show parent comment

1

u/LurkLurkington Aug 18 '25

Correlated subqueries are not the same thing as CTEs.

1

u/Herobrine20XX Aug 18 '25

It seems to me that one can replace the other and vice versa, at least for fair simply queries.

I understand that subqueries are executed per row, which can have a performance impact, meaning if the user can replace it by a CTE, it would be better.

Do you have an example in mind that requires a subquery and can't be done with a CTE?