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
Show the name of aircrafts with top three lowest distances.
assistant
SELECT name FROM Aircraft ORDER BY distance LIMIT 3
human
How many aircrafts have distance between 1000 and 5000?
assistant
SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
human
Show name and distance for all aircrafts.
assistant
SELECT name , distance FROM Aircraft
human
Show ids for all aircrafts with more than 1000 distance.
assistant
SELECT aid FROM Aircraft WHERE distance > 1000
human
Show the id and name of the aircraft with the maximum distance.
assistant
SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1
human
What is the name and distance for aircraft with id 12?
assistant
SELECT name , distance FROM Aircraft WHERE aid = 12 ;