CSc 4710/6710
Spring 1999
Practice Problems for Exam 3
----------------------------

(1) Consider the following relational database scheme:

    frequents(drinker,bar)
    serves(bar,beer)
    likes(drinker,beer)

    where the first relation indicates the bars a drinker visits, 
    the second indicates what beer each bar serves, and the third tells 
    which beers each drinker likes to drink. 

    Express the following queries in TRC, DRC, and Datalog.

    (a) Find bars that serve a beer that Charles Chugamug likes.
    (b) Find drinkers who frequent at least one bar that serves a beer they 
        like.
    (c) Find drinkers who frequent at least all those bars that Charles 
        Chugamug frequents.
    (d) Find drinkers who frequent no bar that serves a beer they like.
    (e) Find drinkers who frequent only bars that serve at least one beer 
        they like.

(2) Using only the Armstrong's axioms (IR1-3), prove the following:

       {X -> YZ, Z -> CW} implies {X -> YZC}

(3) Problems 12.17, 12.19, 12.20