SQL is a lot more intellectually coherent than its syntax belies. It's easy to be attracted to things like SPARQL, which has a well-written simple public spec, or Datalog, which doesn't really have a spec but does CTE in a way that doesn't look so painfully half-baked, or to feel really queasy looking at triggers and other features... but SQL isn't that bad. Dialects like postgres actually have pretty good support for JSON.