|
Posted by bsder on July 14, 2005, 5:29 am
Please log in for more thread options bsder wrote:
> Gordon Burditt wrote:
>
>>> I have the following sql statement written for a Flight center.
>>> Can anyone please help me to find out whether they are correctly
>>> written?
>>>
>>> Case:
>>> There is a database table named flight that contains the following
>>> columns:
>>>
>>> Identifier, Date, Time, FlightNumber, SSRCode, Runway, OperationType,
>>> Airline, AircraftType
>>>
>>> What SQL statement would you use to obtain:
>>>
>>> a) The Number of B737 Aircraft flown each day?
>>> select count(*)
>>
>>
>>> from flight
>>
>>
>>> where Date = day() and Time < time() and FlightNumber = "B737"
>>
>>
>>
>> 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.
>>
Since I don't exactly know what th FlightNumber look like, if B737 is
not associated with FlightNumber, it might be associate with Identifier?
>>
>>> b) How many times Qantas departs each day?
>>> select Date, count(*)
>>
>>
>>> from flight
>>
>>
>>> where Airline = "Qantas" and Date = date() and OperationType =
>>> "Departure"
>>> order by Airline, Date
>>
>>
>>
>> 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.
>>
>>
>>> c) The daily breakdown of the number of Arrivals and Departures?
>>> select count(*)
>>
>>
>>> from flight
>>
>>
>>> where (OperationType = "Arrival" or OperationType = "Departure")
>>> group by Date, OperationType
>>
>>
>>
>> Please post the email address of your instructor so posters can
>> send the correct answer direct.
>>
>> Gordon L. Burditt
>
> Hi,, here is the email addr: tf_sam@yahoo.com.au
>
> d
Thanks
D
|