Csc 8710, Deductive Databases and Logic Programming (Fall 2016)

Homework Assignment 2; Due: 21 Sept, 2016 (Wednesday)

Consider the following relational database schema:

MOVIES(TITLE,Director)
ACTORS(TITLE,ACTOR)
THEATERS(TNAME,Address,Phone)
PLAYS(TNAME,TITLE,STARTTIME)

The key attributes are shown in all capital letters. The MOVIES table records information about current movies, the ACTORS table records information about the different actors acting in each movie, the THEATERS table records information about the various theaters in a city and the PLAYS table records information about which movie is being played in which theater and at what time.

Write DRC, Datalog, RA, and OurSQL expressions to answer the following queries.

  1. Find the directors who have acted in a movie they directed.
  2. Find the movies that are directed by Kurosawa or are being played in theater Odeon.
  3. Find the directors such that EVERY actor has acted in at least one of his or her movies.
  4. Find actors who act ONLY for director Kurosawa.
  5. Find all pairs of actors who act in EXACTLY the same movies.

The database files are available at movies or in a zip format at movies.zip.

Run and test these queries on the system.

SUBMISSION: Please submit files named drc.txt, ra.txt, oursql.txt containing the solutions for all DRC, RA, and OurSQL queries. For Datalog, submit individual queries in separate files named 1.dlg, 2.dlg, 3.dlg, 4.dlg, and 5.dlg.