This question breaks down across 3 completely different lines.
But first, SQL is a descriptive language: You describe what you want, you don't describe how you want it.
Instead, you rely on extremely complicated optimisers and a lot of using `EXPLAIN` to see what's happening under the hood. This is fundamental in the very _point_ of SQL.
Keeping that in mind, what do you mean:
[1] You feel the general notion of doing relational queries using a descriptive language is just broken. In which case, the fact that so many 'simpler' systems decided to add SQL support instead of just relying on the fact that folks will program their way into efficient queries is telling. People like being able to do this.
[2] You think the general notion is great, just, SQL specifically is badly designed. This then breaks down into two explanations.
[2a] You haven't actually read the spec, specifically your DB engine's spec. There's a ton DB engines can do - you can make your own procedures, your own aggregator functions, add triggers, and use VIEWs to combine it all (and VIEWs can act entirely as tables, including letting you INSERT or UPDATE them). For example, I'm pretty sure you can do precisely what you want, or at least get quite close, by only adding a little bit of extra definitions in postgresql. Either you just don't know enough (I'm just guessing here, based on very little info, please don't take it personally), or you do, but you find all that 'needlessly complicated'. In which case I think you're just misjudging how varied (and therefore complicated) your average DB user's needs are. Add the ability to do everything you want, but then for all use cases of people like you, and it is so complicated, you yourself would say 'yeah but not so complicated', and we're right back where we started.
[2b] No you really do know your way around SQL, including all the various exotic features that DB engines, particularly really good ones like psql, offer. And it's not good enough and you think you have a good grasp on how to make SQL specifically better. In which case: That has been done. Multiple times. The XKCD with the 14 standards comes to mind. Here is a REALLY long list of query languages: https://en.wikipedia.org/wiki/Query_language - pick your poison.
But first, think about the fact you didn't know about any of these. Whatever you're planning to 'replace' or 'fix' SQL, isn't that just doomed to be the 19th entry on that wikipedia list, just as forgotten as all the others?
In which case, [A] many, many db engines have extra syntax you might want to look at. You can make recursive queries, windowing functions, define your own procedures, and more - and use VIEWs to let you do precisely what you want. I'm pretty sure you can do precisely what you desire with postgres, using only a fairly simplistic amount of