Fork me on GitHub
#datascript
<
2018-06-15
>
andy.fingerhut20:06:01

Is there some write-up somewhere, preferably with examples, giving a good idea of the kinds of queries expressible in datalog that cannot be expressed in SQL/relational algebra? I believe that the canonical example is queries involving 'paths', e.g. ancestor/descendant queries from parent/child relationships in the data.

metasoarous21:06:55

Datalog is computationally equivalent in power to sql + recursion. Any datalog query that doesn't involve a recursive rule is more or less equivalent to some SQL query. So yes, path related queries, like ancestor descendant relationships, are a prime example of something Datalog can do that SQL cannot (without external iteration/recursion).