human
Schema:
flight (flno, origin, destination, distance, departure_date, arrival_date, price, aid)
aircraft (aid, name, distance)
employee (eid, name, salary)
certificate (eid, aid)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the minimum, average, and maximum distance of all aircrafts.
assistant
SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft
human
Show the flight number and distance of the flight with maximum price.
assistant
SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1
human
How many flights do we have?
assistant
SELECT count(*) FROM Flight
human
Show all flight number from Los Angeles.
assistant
SELECT flno FROM Flight WHERE origin = 'Los Angeles'
human
What is the average price for flights from Los Angeles to Honolulu.
assistant
SELECT avg(price) FROM Flight WHERE origin = 'Los Angeles' AND destination = 'Honolulu'
human
What is the average distance and price for all flights from LA?
assistant
SELECT avg ( distance ) , avg ( price ) FROM Flight WHERE origin = "Los Angeles" ;