CSE3330/5330 Project #4

Thursday April 8, before midnight
Worth 5% of the final grade


Implement in SQL and evaluate in phpMyAdmin the following queries:

  1. For each flight, print the flight number, the departure and the arrival airport.
  2. Give all the flight numbers and departure/arrival times of all flights that depart from DFW and arrive at LAX airport on 6/05/10.
  3. For each airline, print the airline name and the number of its flights departing from DFW on 6/05/10.
  4. For each airport and for each airline, print the airport name, the airline name, and the number of flights of this airline departing from that airport, and the average cost of these flights. (Note: I have removed the restriction about "the economy class").
  5. Print all flight numbers from DFW to LAX that have at least one available seat and cost less than $500 in economy class.
  6. For each flight departing from DFW and arriving at LAX that has at least one available seat, print the flight number and the number of available seats.
You may use names other than DFW, LAX, etc. Write your queries in a file queries.sql and evaluate them using mysql on Omega. You may use phpMyAdmin to run your queries one-by-one before you write them in the file queries.sql and evaluate them using mysql on Omega. You should add more data into your database so that each one of the above queries prints at least two rows. Your report should contain your queries.sql file, a printout of all your data in your database, and a printout of the results when you evaluate your queries against your data. (To get a printout of results in mysql, use the command tee output and then do source queries.sql to execute the queries.)

You may submit it as many times as you like, but only the most recently submitted file will be retained and evaluated.

Submit Project #4:

Last modified: 04/06/10 by Leonidas Fegaras