Answers Datalog practice questions

All are from book exercise 24.1.