Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
July 14, 2005, 7:38 am
rate this thread
I have the following sql statement written for a Flight center.
Can anyone please help me to find out whether they are correctly written?
There is a database table named flight that contains the following columns:
Identifier, Date, Time, FlightNumber, SSRCode, Runway, OperationType,
What SQL statement would you use to obtain:
a) The Number of B737 Aircraft flown each day?
where Date = day() and Time < time() and FlightNumber = "B737"
b) How many times Qantas departs each day?
select Date, count(*)
where Airline = "Qantas" and Date = date() and OperationType = "Departure"
order by Airline, Date
c) The daily breakdown of the number of Arrivals and Departures?
where (OperationType = "Arrival" or OperationType = "Departure")
group by Date, OperationType
Re: Correctness/efficiency of some sql statements
I don't pretend to know a lot about airports, but a flight number
is not a type of aircraft on any flight I have ever been on. "flown
each day" would appear to ask for grouping each day's flights so
you could count them, giving a list of days and flights. The current
day and time are irrelevant.
Again, "departs each day" would appear to ask for a list of days
and number of flights on that day. The current date is irrelevant.
Please post the email address of your instructor so posters can
send the correct answer direct.
Gordon L. Burditt
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum