CSCE 520 Final Exam Thursday December 14, 2017

Similar documents
World Class Airport For A World Class City

World Class Airport For A World Class City

World Class Airport For A World Class City

World Class Airport For A World Class City

2016 Air Service Updates

2016 Air Service Updates

2016 Air Service Updates

2016 Air Service Updates

Passengers Boarded At The Top 50 U. S. Airports ( Updated April 2

ACI 2008 WORLDWIDE AIRPORT TRAFFIC STATISTICS

79006 AIR TRAVEL SERVICES 2001 AWARD

Airports Council International

Brian Ryks Executive Director and CEO

Preliminary World Airport Traffic 2010 Passenger traffic up 6.3%; Cargo up 15.2%

TravelWise Travel wisely. Travel safely.

Megahubs United States Index 2018

Rankings of Major U.S. Airports. Total Passengers 2017

Airport Characteristics. Airport Characteristics

Rankings of Major U.S. Airports. Total Passengers 2016

Air France is proud to be the first European airline to fly the A380

Solutions to Examination in Databases (TDA357/DIT620)

Preliminary World Airport Traffic 2008 Passenger traffic growth flat; Cargo down by 3.6 percent

Vanderbilt Travel January 2019 Airfare Price Testing Testing Session, January 14, 9:30am 10:30am

turnaround tables Arriving and Departing OTP Variances for the World s Largest Airports Based on full year data 2017

Hakodate Station (JR Train) >> Onuma Please use the hotel bus. To Hakodade-city. Narita A/P>>Haneda A/P >> Hakodate A/P

2012 Airfares CA Out-of-State City Pairs -

AGENCY: U.S. Customs and Border Protection; Department of Homeland Security.

Impact of Advance Purchase and Length-of-Stay on Average Ticket Prices in Top Business Destinations

Selected highlights: The burgeoning Pacific market

Preliminary World Airport Traffic 2011 Passenger traffic up 4.9%; Cargo flat -0.1%

Airfare and Hotel Rate Volatility:

DUBLIN INTERNATIONAL AIRPORT DUB S14 Start of Season Report

Trends Shaping Houston Airports

PITTSBURGH INTERNATIONAL AIRPORT ANALYSIS OF SCHEDULED AIRLINE TRAFFIC. October 2016

CONCESSIONS FUTURE OPPORTUNITIES

Preliminary World Airport Traffic 2009

2011 AIRPORT UPDATE. March 25, 2011

ELS Language Centers 2019 USA Pricing

Air Travel travel Insights insights from Routehappy

Growing Size and Complexity Prof. Amedeo Odoni

The Best Airlines in Belize

A Decade of Consolidation in Retrospect

Airport Code BTR Airport Code GGG. Departure Times Arrival Times Departure Times Arrival Times

Distance to Jacksonville from Select Cities

Dallas/Fort Worth International Airport Development Opportunities Southgate Plaza

Unit Activity Answer Sheet

Executive Summary with Graphs

Our view on Baggage Process Control

Pacific Airways I S N T T H E W O R L D A S M A L L P L A C E? Operations Manual v 2.3. Revised: Dec. 1, Updated by Tom Detlefsen

Airports Council International North America Air Cargo Facilities and Security Survey

Transportation: Airlines

2010 US/Europe comparison of ATM-related operational performance

Global Airline Capacity Winter 2013/14 Boeing Commercial Airplanes

take-off essential metrics on the world s major airlines

Flights as of October 8, 2017

DEPARTMENT OF HOMELAND SECURITY U.S. CUSTOMS AND BORDER PROTECTION. CBP Dec. No EXPANSION OF GLOBAL ENTRY TO NINE ADDITIONAL AIRPORTS

FINAL EXAM: DATABASES ("DATABASES") 22/06/2010 SCHEMA

trends bulletin

trends bulletin 07/2011 Main airlines traffic 1 s quarter 2011 Main low cost airlines

JFK LHR. airports & flight connections

Established and Emerging Hubs in the last Decade

Economics of International Airline Joint Ventures. Bryan Keating Georgetown Airline Competition Conference July 17, 2017

Megahubs International Index

trends bulletin

Lower Income Journey to Work Market Share From American Community Survey

Global Aviation Monitor (GAM)

STATE OF UTAH "BEST VALUE" COOPERATIVE CONTRACT CONTRACT NUMBER: AR2270 November 14, 2016

Megahubs International Index 2018

Suggested Arrival Time Prior to Departure: 1 Hour. Suggested Arrival Time Prior to Departure: 2 hours

Main airlines traffic 3 rd quarter nd quarter 16/15. 1st quarter 16/15. 3rd. quarter 16/15 01/ nd quarter 16/15. 3rd quarter 16/15.

Alliances: Past, Present, And Future JumpStart Roundtable. Montreal June 2, 2009 Frederick Thome Director Alliances

Supportable Capacity

Global Aviation Monitor (GAM)

01/2016. Main airlines traffic 2015 (1) RPK* (millions) /14 (% ) 1st quarter 16/15 (% ) Airlines

Global Aviation Monitor (GAM)

HUBS, COMPETITION AND GOVERNMENT POLICY

Semiintensive. (Semi) 4

PVC Competitor Airports & Customer Service Outcomes

8 th USA/Europe Air Traffic Management R&D Seminar. US/Europe comparison of ATM-related operational performance. June 30, 2009 Napa Valley, California

Fisherman s Cabanas Resort. Citizenship By Investment

Sitting on the Runway: Current Aircraft Taxi Times Now Exceed Pre-9/11 Experience

The O Hare Effect on the System

Global Aviation Monitor (GAM)

The Anatomy of Delays:

Global Aviation Monitor (GAM)

WH Smith PLC Acquisition of InMotion providing access to the world s largest travel retail market 30 October 2018

Rank Place State Native Hawaiian and Pacific Islander population (alone or in combination

Statement of Policy for Authorizations to Operators of Aircraft that are Not Equipped with

trends bulletin

Hewanorra International Airport Flight Schedule For the Month February, 2016

Puget Sound Trends. Executive Board January 24, 2019

trends bulletin 01/2012 Main airlines traffic 3 rd quarter 2011 Main low cost airlines

Why do we need well performing airports?

September Air Traffic Statistics. Prepared by the Office of Marketing & Consumer Strategy

BEFORE THE DEPARTMENT OF TRANSPORTATION OFFICE OF THE SECRETARY WASHINGTON, D.C.

Buffalo Niagara International Airport Airline Competition Plan Fiscal year 2017

Industry Voluntary Pollution Reduction Program (VPRP) for Aircraft Deicing Fluids

To receive a Certificate of Completion, please provide information requested in the session sign-in sheet for each session attended

ATRS Global Airport Benchmarking Report 2003

Activity Template. Drexel-SDP GK-12 ACTIVITY. Subject Area(s): Sound Associated Unit: Associated Lesson: None

Transcription:

CSCE 520 Final Exam Thursday December 14, 2017 Do all problems, putting your answers on separate paper. All answers should be reasonably short. The exam is open book, open notes, but no electronic devices. You have two and a half hours; pace yourself accordingly. When you submit your exam pages, staple them together with a single staple in the upper left-hand corner. A stapler will be provided. Make sure your name is on at least the first page. During the test, BE SURE NOT TO WRITE ANYTHING IN THE AREA THAT WILL BE UNDERNEATH THE STAPLE. There are 140 points total. 120 points constitutes full credit, and undergraduates get a free 12-point boost. Any score in excess of full credit counts as extra credit. Note that questions are not necessarily given in order of presentation in class or of difficulty. 1. (30 points total) Let R(A, B, C, D, E) be a relation whose schema satisfies the following functional dependencies: B E BE A C D CD E (a) (5 points) Compute the closures {A} +, {B} +, and {C} +. (b) (5 points) List all keys of R. (c) (5 points) List the FDs that hold in π A,B,C (R). You can omit FDs that follow from those you list. (d) (15 points) Decompose R completely into BCNF relations as efficiently as possible without losing any information (lossless join). Use the method described in the textbook or in class. (You may lose some FDs in the decomposition; that is OK.) There may be more than one correct answer. 2. (5 points) Let R and S be the following two tables, respectively: A B B C ---+--- ---+--- 1 3 2 4 4 2 3 2 3 3 2 3 3 1 1 2 Write a table for π A,C (σ A>C (R S)), assuming bag operations. Tuple order does not matter. 3. (45 points total) Assume our usual relational database schema for students taking classes: Student(sid, name, status) Class(prefix, courseno, semester, instructor) Course(prefix, courseno, title) Takes(sid, prefix, courseno, semester, grade) Where: The primary key for Student is (sid). The primary key for Class is (prefix, courseno, semester). The primary key for Course is (prefix, courseno). The primary key for Takes is (sid, prefix, courseno, semester). grade is of numerical type, between 0.0 and 4.0.

For parts (b,c,d) you may use subqueries as you see fit, provided they are reasonable. (a) (10 points) Give a relational algebra expression for the course titles and instructors of all CSCE classes taught in Fall 2017 where the student with the highest grade is named Ahmed. (b) (10 points) Give an SQL query for the above that is not gratuitously complex. (c) (10 points) Give a data modification statement in SQL that boosts Ahmed s grade up to 2.0 in every MATH class taught by Eva that he has taken where he got a grade lower than 2.0. (Note that all students named Ahmed might benefit from this.) (d) (15 points) Recall that the CREATE ASSERTION command in SQL has syntax CREATE ASSERTION <assertion-name> CHECK (<condition>); and creates the global constraint that <condition> must hold at all times. Suppose we add the following table to the schema above: InMajor(prefix, courseno) A tuple (p, n) in this relation indicates that the course with prefix p and course number n is a required course for all majors in the program (given by the prefix p). Give a CREATE ASSERTION command that enforces the requirement that any student taking a course in the CSCE major numbered 300 or above must have in previous semesters taken (with a grade of 2.0 or better) all courses in the CSCE major numbered less than 300. (The CSE department at USC had this requirement until recently.) For this, you can assume (not actually true) that semester values are ordered chronologically by <, <=, etc. E.g., semester1 < semester2 means that semester1 occurs before semester2. 4. (40 points total) Consider the following relational database schema: Airport( code, name, city, capacity ) /* name: the name of the airport (e.g., Hartsfield-Jackson ) code: a three-letter code (e.g., CLT ) city: the name of the city served by the airport (e.g., Atlanta, GA ) capacity: the maximum number of planes per day through the airport Airline( name, headquarters ) /* name: the name of the airline (e.g., Aeroflot ) headquarters: the city (e.g., Moscow, RU ) where the airline s headquarters is DailyFlight( flightno, airline, departcode, arrivecode ) /* flightno: the flight number (a code of up to 8 characters, e.g., DL1701 ) airlinename: the name of the airline that runs the flight departcode: the three-letter code of the airport from which the flight leaves arrivecode: the three-letter code of the airport at which the flight arrives Assume the following constraints on the data: Primary Keys: A airport is uniquely identified by its code. An airline is uniquely identified by its name. A daily flight is uniquely identified by its flight number. Value Constraints: All airports must have positive capacity. The name of an airport cannot be null. Referential Integrity: A airlinename appearing in the DailyFlight table must also appear as a name in the Airline table. Both the depart and arrive codes for a daily flight must also appear as codes in the airport table. (a) (15 points) Give CREATE TABLE commands in SQL for the three relations above, giving attribute types that are reasonably appropriate and consistent. Also incorporate the given constraints. (b) (10 points) Express the constraint (in the form R =, where R is some expression in relational algebra) that if some flight arrives at an airport, then some flight run by the same airline must depart from the same airport.

(c) (15 points) Suppose the tables described above are made up of the following tuples: Airport: name code city capacity Hartsfield-Jackson ATL Atlanta, GA 1260 Logan BOS Boston, MA 200 Columbia CAE Columbia, SC 30 De Gaulle CDG Paris, FR 800 Charlotte-Douglas CLT Charlotte, NC 400 Metro DTW Detroit, MI 250 Newark EWR Newark, NJ 600 Frankfurt FRA Frankfurt, GR 2000 Kennedy JFK New York, NY 1659 Los Angeles LAX Los Angeles, CA 1350 LaGuardia LGA New York, NY 1700 Gatwick LGW London, UK 1000 Heathrow LHR London, UK 700 Midway MDW Chicago, IL 50 Narita NRT Tokyo, JP 800 O Hare ORD Chicago, IL 1490 Orly ORY Paris, FR 650 Sheremetyevo SVO Moscow, RU 900 Airline: name headquarters Aeroflot Moscow, RU Air France Paris, FR American Dallas, TX British Airways London, UK Delta Atlanta, GA JAL Tokyo, JP Lufthansa Frankfurt, GR Midway Chicago, IL Northwest Detroit, MI United Chicago, IL Virgin Pacific Seattle, WA DailyFlight: flightno airlinename departcode arrivecode L201 Lufthansa FRA CLT DL1287 Delta ATL JFK DL790 Delta ORD LAX AF016 Aeroflot SVO JFK UA310 United LAX NRT AF521 Air France ORY CLT NWA549 Northwest FRA DTW BA120 British Airways BOS LHR AF6223 Air France LHR ORY L202 Lufthansa CLT FRA What is returned by the following SQL queries? (You can suppress duplicate entries if you want.) (a) SELECT city FROM Airport WHERE capacity > 200; (b) SELECT headquarters FROM Airline, DailyFlight WHERE name = airlinename AND arrivecode in ( CLT, LAX, JFK ); (c) SELECT city, flightno FROM Airport, Airline, DailyFlight WHERE code = arrivecode AND name = airlinename AND headquarters = Chicago, IL ;

5. (20 points total) This problem refers to an XML document with product data, stored locally with file name proddata.xml. The root element of this document is shown in Figures 12.5 and 12.5 on pages 526 527 of the textbook. That element is reproduced below with a slight correction (restoring a missing tag): <Products> <Maker name = "A"> <PC model = "1001" price = "2114"> <Speed>2.66</Speed> <HardDisk>250</HardDisk> <PC model = "1002" price = "995"> <Speed>2.10</Speed> <RAM>512</RAM> <HardDisk>250</HardDisk> <Laptop model = "2004" price = "1150"> <Speed>2.00</Speed> <RAM>512</RAM> <HardDisk>60</HardDisk> <Screen>13.3</Screen> <Laptop model = "2005" price = "2500"> <Speed>2.16</Speed> <HardDisk>120</HardDisk> <Screen>17.0</Screen> <Maker name = "E"> <PC model = "1011" price = "959"> <Speed>1.86</Speed> <RAM>2048</RAM> <HardDisk>160</HardDisk> <PC model = "1012" price = "649"> <Speed>2.80</Speed> <HardDisk>160</HardDisk> <Laptop model = "2001" price = "3673"> <Speed>2.00</Speed> <RAM>2048</RAM> <HardDisk>240</HardDisk> <Screen>20.1</Screen> <Printer model = "3002" price = "239"> <Color>false</Color> <Type>laser</Type>

<Maker name = "H"> <Printer model = "3006" price = "100"> <Color>true</Color> <Type>ink-jet</Type> <Printer model = "3007" price = "200"> <Color>true</Color> <Type>laser</Type> </Products> (a) (10 points) What, specifically, is returned by the following XQuery expression, when run on the document above? let $prods := doc("proddata.xml")/products let $bigpcs := ( for $maker in $prods/maker, $pc in $maker/pc where $pc/ram > 2000 or $pc/harddisk > 200 return <BigPC model = {$pc/@model} maker = {$maker/@name} /> ) return <BigPCs>{$bigPCs}</BigPCs> For readability s sake you may break lines and indent as appropriate. (b) (10 points) Write an XQuery expression that finds the names of those makers that make both printers and PCs (i.e., where at least one printer and at least one PC are made by the same maker). The result should be a sequence of names. Your query should work in general, not just on the specific data given above.