Part 1. Part 2. airports100.csv contains a list of 100 US airports.

Similar documents
Project 2 Database Design and ETL

Project 2 Database Design and ETL

Passenger Rebooking - Decision Modeling Challenge

ADVANTAGES OF SIMULATION

Kristina Ricks ISYS 520 VBA Project Write-up Around the World

Global formulas. Page1. Video filmed with GeneXus X Evolution 2

SWEN502 Foundations of Databases Session 2. Victoria University of Wellington, 2017, Term 2 Markus Luczak-Roesch

Daily Traffic Survey (DTS) File formats XLS, XLSX, CSV

myidtravel Functional Description

e-crew Horizon Air Trip Trades Notes for the Flight Attendants

Federal GIS Conference February 10 11, 2014 Washington DC. ArcGIS for Aviation. David Wickliffe

TIMS & PowerSchool 2/3/2016. TIMS and PowerSchool. Session Overview

Implementation challenges for Flight Procedures

myldtravel USER GUIDE

Lesson: Total Time: Content: Question/answer:

TIMS to PowerSchool Transportation Data Import

Solutions to Examination in Databases (TDA357/DIT620)

e-crew Horizon Air Pilot Trip Trades Phase I Notes for the Crewmembers

Model Solutions. ENGR 110: Test 2. 2 Oct, 2014

Air Operator Certificate Issue / Renewal Application Form (Flight Standards Directorate CAA Pakistan)

Table of Contents. Part I Introduction 3 Part II Installation 3. Part III How to Distribute It 3 Part IV Office 2007 &

Airline Monthly Point to Point Guidance Notes

etrust SiteMinder Connector for Oracle Solutions Architecture, Installation and Configuration Guide For UNIX Version 1.6 (Rev 1.

Angel Flight Information Database System AFIDS

Management System for Flight Information

Myth Busting MyTravel. Kim Coleman and Nancy Herbst 26, March 2014

SENIOR CERTIFICATE EXAMINATIONS

Menlo Park Fire District Training Division. Unmanned Aerial System Pilot

For background, this article was originally written some months ago and has made many passes

Completing a Constructed Travel Worksheet Voucher

Cluster A.2: Linear Functions, Equations, and Inequalities

To Be Or Not To Be Junior Manned/Extended

Table of Contents. Part I Introduction 3 Part II Installation 3. Part III How to Distribute It 3 Part IV Office 2007 &

Pricing Challenges: epods and Reality

American Airlines Next Top Model

Methodology and coverage of the survey. Background

Do Not Write Below Question Maximum Possible Points Score Total Points = 100

ELOQUA INTEGRATION GUIDE

COVER SHEET. Reduced Vertical Separation Minimum (RVSM) Information Sheet Part 91 RVSM Letter of Authorization

Schedule Compression by Fair Allocation Methods

Completing a Constructed Travel Worksheet Authorization

AAPA 2017 COMMUNICATION AWARDS CATEGORY: OVERALL CAMPAIGN

Predicting Flight Delays Using Data Mining Techniques

Clarification of Implementation of Regulations and Exemption Policy With Regard to Early Implementation and Transition

Official Journal of the European Union L 186/27

Air Travel: An Introduction (Higher) Selling Scheduled Air Travel (Higher)

ICFP programming contest 2017 Lambda punter (1.3)

SERVICE AGREEMENT. The Parties agree as follows: 1. SERVICE AGREEMENT:

Annex 5: Technical Terms and Conditions for Lot IV: Committee of the Regions

MIT ICAT. Robust Scheduling. Yana Ageeva John-Paul Clarke Massachusetts Institute of Technology International Center for Air Transportation

An Analysis of Dynamic Actions on the Big Long River

Management System for Flight Information

Title ID Number Sequence and Duration. Age Level Essential Question Learning Objectives

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

EVALUATION MANUEL PARTIE D DSA.AOC.CHKL.075

INTERNATIONAL CIVIL AVIATION ORGANIZATION WESTERN AND CENTRAL AFRICA OFFICE. Thirteenth Meeting of the FANS I/A Interoperability Team (SAT/FIT/13)

TILOS & P3 DATA INTERFACE PAUL E HARRIS EASTWOOD HARRIS PTY LTD. 24 July 2007

Bank Holiday Calculator (Oracle Package)

e-airportslots Tutorial

CISC 7510X Midterm Exam For the below questions, use the following schema definition.

CASS & Airline User Manual

Reporting Instructions FILING REQUIREMENTS

DATA-DRIVEN STAFFING RECOMMENDATIONS FOR AIR TRAFFIC CONTROL TOWERS

AERODROME CONTROLLER (ADC) EXAM BRIEFING GUIDE AND EXAM STANDARDS

SWIM Flight Data Publication Service (SFDPS)

Physical Security Fleets Analyzer Saved Searches... 62

10/2017. General Aviation Job Creation Government Choices. AMROBA inc

AQME 10 System Description

LIFE TRAVEL THE MIDDLE SEAT. American, Delta, United and others are prepping streamlined systems that could skew their lost-luggage stats

PARKS CANADA SIGNING ALONG PROVINCIAL HIGHWAYS

Logic Control Summer Semester Assignment: Modeling and Logic Controller Design 1

VATUSA PHOENIX TRACON and VATUSA PHOENIX ATCT LETTER OF AGREEMENT. SUBJECT: Interfacility Coordination Procedures

Entry of Flight Identity

Modifying a Reflex Workflow

Air Operator Certification

Specialty Cruises. 100% Tally and Strip Cruises

HOW TO USE THE NATIONAL ROUTEING GUIDE

Concur Travel-Frequently Asked Questions

IPSOS / REUTERS POLL DATA Prepared by Ipsos Public Affairs

ICAO Changes to the Present Flight Plan Form. Amendment 1 to the PANS-ATM Fifteenth Edition (PANS-ATM, Doc 4444) Tom Brady ICAO HQ

CSCE 520 Final Exam Thursday December 14, 2017

PSEG Long Island. Community Distributed Generation ( CDG ) Program. Procedural Requirements

Click the Profile link to review and update your profile. You must save your profile before you first attempt to book a trip. TOP

Solutions for CAT 2017 DILR Morning (Slot-1)

2018 Cathay Pacific Virtual 2 P a g e

If any rules are not clearly defined in English, the German original shall serve as masterversion.

1.- Introduction Pages Description 21.- Tutorial 22.- Technical support

khz CHANNEL SPACING

Developing an Aircraft Weight Database for AEDT

Fox World Travel/Concur Documentation Concur FAQ

Course Project. 1. Let staff make entries when a passenger makes reservations on a flight.

Query formalisms for relational model relational algebra

NOTAM Submission and Retrieval

DIRECTORATE OF AIR TRAFFIC MANAGEMENT. RAJIV GANDHI BHAWAN, NEW DELHI [File No. AAI/ATM/SQMS/31-16/2016] ATMC

CompSci 101 Exam 2 Sec01 Spring 2017

PLAN Anoka County - Blaine Airport

Wrapper Instruction Register (WIR) Specifications

Real-Time Control Strategies for Rail Transit

Transportation Timetabling

Introduction to Data Management CSE 344

Transcription:

.. Fall 2007 CSC/CPE 365: Database Systems Alexander Dekhtyar.. Lab 8: PL/SQL Due date: Thursday, November 29, midnight Assignment Preparation The main part of this assignment is to be done in teams. The remaining part is individual. You can organize yourselves in teams of 2-3 people each. Once you build your team, one member of the team needs to email me at dekhtyar@csc.calpoly.edu. The email message should have the header CSC 365: Lab 8". In the body of the message, please put the names and emails of all team members. Lab Assignment In a Nutshell The lab consists of parts: Part 1. (individual) Fix all queries from Labs 4 and 6. Part 2. (team) Create a PL/SQL package of functions and procedures for the new AIRLINES dataset. This part tests your ability to extend the functionality of SQL with PL/SQL code for transitive closure (i.e., reachability). AIRLINES Dataset The AIRLINES dataset represents information about airlines, airports and connections between airports. There are three.csv files in the dataset. airlines.csv contains a list of airlines with some information about them. 1

airports100.csv contains a list of 100 US airports. flights.csv contains a list of flights (connections) between different airports. Each airline operates 50 routs. Each route connects two different airports A1 and A2. The airline operates two flights on each route: one flight goes from A1 to A2 and one from A2 to A1. More information about the AIRLINES dataset can be found in its README file. The AIRLINES dataset can be downloads from the class web page: http://www.csc.calpoly.edu/ dekhtyar/365-fall2007/ Note, that the AIRLINES dataset is very simplistic. It does not record information about the arrival and departure times of the flights, neither does it provide any realistic data: all connections are randomly generated. Part 1 Using the gradesheets from Labs 4 and 6, revisit your submissions and fix your queries to provide correct answers. For Lab 4, you can use the row-count file available from the course web page as the guide. If you have questions regarding specific Lab 6 queries, ask the instructor. There is no deliverable for this part, but queries like those in Lab 4 and Lab 6 will be asked on the final exam, so, this part of the lab goes towards your final exam preparation. This is an individual task, and should be done outside of the lab time, or after the team part of the lab is completed. Part 2 You are asked to form groups of 2-3 people. The goal of each group is to build a PL/SQL package which provides important functions and procedures for the AIRLINES database. The functions will be used from SQL queries to the database. The procedures will be called from anonymous PL/SQL blocks. The list of tasks is outlined below. 1. Create Database. Convert the AIRLINES dataset into an Oracle database. Follow the same basic procedures that you used in Labs 2 and 3. Your database schema should match the.csv file columns one-to-one. Create SQL scripts AIRLINES-setup.sql (CRE- ATE TABLE statements), AIRLINES-insert.sql (INSERT INTO statements) and AIRLINES-cleanup.sql (DROP TABLE statements). AIRLINES-insert.sql should contain all INSERT INTO statements for all tables in the AIR- LINES database. Make certain you populate databases in the right order (if table X has a foreign key onto table Y, then table Y needs to be populated first). 2

2. Create package. Create and test PL/SQL package airline ops. The package shall consist of the functions and procedures described in the section below. You are allowed to declare any additions variables, constants, data types, functions and procedures, to help you build the mandatory functionality. You are also allowed to include package initialization code. Please, make sure you document each component of the package. The deliverable is an SQL script airline ops.sql which shall contain create package and create package body statements. String Values in.csv Files in AIRLINES dataset Please note the following important detail. All character data in the airports100.csv table contains one trailing space symbol. This is of particular importance, because three-letter airlines codes are used as unique identifiers of the airports. For example, MRI is the unique identifier of the Merril Field, Anchorage. However, in the airports100.csv file, this value is MRI. You have the following choices: strip trailing spaces before data gets inserted into the database. store data in the database with trailing spaces. When information is retrieved for the purpose of comparison, string trailing spaces from the retrieved values. store date in the database with trailing spaces. When information is retrieved for the purpose of comparison, keep trailing spaces in the data retrieved from the datbase, and add trailing spaces to any strings used in comparison. I recommend the first approach - there is only one place where this needs to be coded. In the other two approaches, the code will have to be written pretty much for every function/procedure. Package airline ops Functions and procedures of the airline ops package will take as input parameters identifying individual airports and airlines. Airports are always identified by their three-letter code. Note, input parameters will always be three-letter codes, NOT extended with a trailing space (i.e., MRI, NOT, MRI ). Airlines may be identified either by their unique Id number, or by their name. This will be stated specifically in each case. The following functions and procedures shall be implemented in the package airline ops. 3

procedure add flight(flight Number in binary integer, Airline in varchar2, Airport1 in varchar2, Airport2 in varchar2); This procedure adds two flights to the table of flights: a flight from Airport1 to Airport2 with filght number Flight Number, and a return flight from Airport2 to Airport1 with flight number Flight Number+1. The following must be taken into account: Airline refers to the values in the third columns of Airlines.csv (e.g., Delta or JetBlue ). Flight numbers must be kept unique for each airline. Your code must check if Flight Number and/or Flight Number+1 have already been used in the database, for the given airline. The procedure shall perform no insertions, and return, if a duplicate flight number insertion is attempted for an airline. At the same time, there may be multiple flights between two destinations, even run by the same airline. procedure list destinations(airport in varchar2); This procedure takes as input an airport, and outputs, i.e., prints to the output buffer, all airports (except for itself) that are reachable form it. For each airport, the information from the first three columns of the airports100.csv file needs to be reported. procedure list destinations airline(airport in varchar2, Airline in varchar2); Takes as input the airport code and the airline (values from the third column of the airlines.csv file). Prints to the output buffer the list of all (excluding the input airport) destination airports (three first columns from the airports100.csv) for all airports reachable from the input airport using only flights of the specified airline. procedure list destinations legs(airport in varchar2, connections in binary integer); Takes as input the airport code and the number of connections or legs desired. Prints to the output buffer the list of all (excluding the input airport) destination airports (three first columns from the airports100.csv) which can be reached from the input airport in connections legs or fewer. That, is, list destinations legs( MRI,2) shall print all airports reachable from MRI in one step (i.e., via a direct flight) and all airports reachable from MRI with one transfer (i.e., in two legs). MRI itself should be excluded from the output. procedure path(airport1 in varchar2, Airport2 in varchar2); This procedure takes as input the source (Airport1) and the destination (Airport2) airports and produces and prints to the output buffer, the list of flights a passenger would need to take to get from Airport1 to Airport2. Only one path between the airports needs to be reported. Report each flight on a 4

separate line. Specify the code for the source airport, the code for the destination airport, flight number, and the name of the airline (full name: the second column from the airlines.csv file). Note: there is no requirement that the reported path is the shortest, but you must ensure that the reported path does not contain loops. If Airport2 is not reachable from Airport1, the procedure shall print to the output buffer the appropriate diagnostic statement and graciously return. function connected(airport1 in varchar2, Airport2 in varchar2) returns boolean; this function returns true if there is a path between Airport1 and Airport2, and false otherwise. function connected airline(airport1 in varchar2, Airport2 in varchar2m Airline in varchar2); This function returns true if there is a path between Airport1 and Airport2, that uses only flights by airline Airline. It returns false otherwise. procedure find airlines(airport1 in binary integer, Airport2 in binary integer); takes as input the airport codes for the source and the destination airports and prints to the output buffer the names of airlines (full names) a passenger must use to travel between the two airports. (basically, this procedure needs to find a path between the airports, if one exists, and output the names of all airlines whose flights are on the path). Extra Credit Extra credit is assessed for the following: Implementing the shortest path algorithm for the path procedure and for the find airlines procedure. (a 50% markup for the score for each procedure). Implementing one or more components of the package using recursion. (25% markup for each recursive procedure/function). Implementing, for each procedure of the package, a twin function which, instead of printing the result to the output buffer, returns it as a table. (Each twin function earns a bit of extra credit independently of other twin functions). (each function earns the same amount of points as its twin procedure). Submission Instructions Email instructor a.zip or.tar.gz file containing the following files: 5

AIRLINES-setup.sql AIRLINES-insert.sql AIRLINES-cleanup.sql airline ops.sql README Each file must contain a comment block at the top listing all members of the group. README file shall contain the specifications for the extra credit functionality, if any has been comleted. 6