Homework #1 (due 02/17/11)
2 pages - 98.4 KB
1.3: find all the actors that starred in all movies starring harrison ford. write the following queries in sql: • 1.4: for every actor, list the actor and ...
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...