Datalog Rules and Queries
A datalog rule has the following form:
head :- atom1, atom2, …., atom,…
ExpensiveProduct(X) :- Product(X,Y,P), P > $100
Product(X,Y,P), Company(P, “UK”, SP)
P(X,Y) :- Between(X,Y,Z), NOT Direct(X,Z)
A single rule can express exactly select-from-where queries.