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
How many different aircrafts are there? | Do you mean different names of aircrafts? | Yes, how many different names.
assistant
SELECT COUNT( distinct name ) FROM aircraft;
human
Show me the name of the aircraft with the fewest people who have its certificate
assistant
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY COUNT( * ) ASC LIMIT 1;
human
How many people have the 747-400 certificate? | Do you mean the name of Boeing 747-400 in the Boeing 747-400 table ? | yes
assistant
SELECT COUNT( * ) FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.name = "Boeing 747-400" ;