/ 0
60%
Table of contents

Document in text mode:

CSE562:Homework#1(due02/17/11)Youaregiventhefollowingrelationalschema:MOVIE(TITLE,DIR,YEAR,BUDGET)CAST(TITLE,ACTOR).Keysareunderlined.TheattributeTITLEinCASTisaforeignkeyreferencingMOVIE(TITLE).Problem1(24pts)WritethefollowingqueriesinrelationalalgebraandSQL:•1.1:FindallthedirectorsofthemoviesstarringHarrisonFord;•1.2:Findalltheactorsthatstarredin“StarWars”butnotin“ReturnoftheJedi”;•1.3:FindalltheactorsthatstarredinallmoviesstarringHarrisonFord.WritethefollowingqueriesinSQL:•1.4:Foreveryactor,listtheactorandthenumberofmovieshe/shemadeunderthedirectionofStevenSpielberg;•1.5:Findalltheactorswiththehighestnumberofmovieswhosebudgetwasovertheaveragemoviebudget.Problem2(8pts)YouaregivenarelationschemaCONNECTION(ORIGIN,DESTINATION,AIRLINE)representingairlineconnec-tions.WritethefollowingqueriesinSQL,possiblyusingrecursion:•2.1:Foreverycity,findthenumberofcitiesconnectedtoitusingasingleairlinewithatmostonestopover.Theconnectionsmaybeindirect.•2.2:FindallthecitiesconnectedtoBuffalousingarbitrarya...