I find SQL very hard to use when the data schema and/or transformation graph needs to be dynamic (e.g. depends on the data itself). It's hard to make SQL dynamic even at build time -- Jinja+SQL is one of the worst development experiences I have ever had.
I use graph database, and resources of the graph are typed with types/supertypes. Relationships also are typed with types/supertypes.
And my queries are heavily dependant on that typing structure.
Honestly, I cannot live without that feature.
[sorry, that is my OOP minute. Continue without me...]