Is DataLog equivalent to SQL?

Viewed 282

If Datalog is based on first order logic which is equivalent to SQL, how come Datalog can express transitivity (which is inexpressible in SQL/first order logic)?

https://en.wikipedia.org/wiki/Datalog

This clearly means Datalog is more expressive than SQL is,

http://www.learndatalogtoday.org/

Says that it has expressive power of SQL. Does it mean that Datomic is doing a subset of datalog? Or is Datalog First order logic with fixpoints? What am I missing here?

1 Answers

I think you are right. Datalog is first order logic with fixed points, while classical SQL is pure first order logic. Practically this comes from Datalog allowing recursion and classical SQL not having an expression for recursion.

Related