Csc 8710, Deductive Databases and Logic Programming (Fall 2012)
Homework 2 (Due: September 17th - Monday)
Consider the following relational database scheme (primary key attributes are shown in CAPITAL LETTERS):drinker(DNAME) bar(BNAME) beer(RNAME,price) frequents(DNAME,BNAME) serves(BNAME,RNAME) likes(DNAME,RNAME)where
frequents indicates the bars a drinker visits
serves indicates what beer each bar serves
likes tells which beers each drinker likes to drink.
Write and execute DRC, DLOG, RA, and OurSQL expressions to answer the following queries:
- Find bars that serve a beer that Clark likes.
- Find drinkers who frequent at least one bar that serves a beer they like.
- Find drinkers who frequent at least all those bars that Peter frequents.
- Find drinkers who frequent no bar that serves a beer they like.
- Find drinkers who frequent only bars that serve at least one beer they like.
- Find pairs of drinkers who frequent EXACTLY the same bars.
- Find the second costliest beer(s).
Submission Instructions
Run the following command on tinman.cs.gsu.edu server:sudo handin8710 2 file1 file2 ...Here 2 stands for assignment number. In the future this will be 3, 4, etc. For this assignment, please place all DRC queries in a single file named drc, all RA queries in a file named ra, OurSQL queries in a file named oursql, individual Datalog queries in separate files named q1, q2, etc. You may zip all these in one file hw2.zip and submit it as follows:
sudo handin8710 2 hw2.zip