Converting Non-Recursive Datalog to SQL