richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: How many flights have a velocity larger than 200? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select count ( * ) from flight where velocity > 200

### Instruction:

Convert text to sql: List the vehicle flight number, date and pilot of all the flights, ordered by altitude. | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select vehicle_flight_number , date , pilot from flight order by altitude asc

### Instruction:

Convert text to sql: List the id, country, city and name of the airports ordered alphabetically by the name. | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select id , country , city , name from airport order by name asc

### Instruction:

Convert text to sql: What is maximum group equity shareholding of the companies? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select max ( group_equity_shareholding ) from operate_company

### Instruction:

Convert text to sql: What is the velocity of the pilot named 'Thompson'? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select avg ( velocity ) from flight where pilot = 'Thompson'
### Instruction:

Convert text to sql: What are the names and types of the companies that have ever operated a flight? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select operate_company.name , operate_company.type from operate_company join flight on operate_company.id = flight.company_id

### Instruction:

Convert text to sql: What are the names of the airports which are not in the country 'Iceland'? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select name from airport where country != 'Iceland'

### Instruction:

Convert text to sql: What are the distinct types of the companies that have operated any flights with velocity less than 200? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select distinct operate_company.type from operate_company join flight on operate_company.id = flight.company_id where flight.velocity < 200

### Instruction:

Convert text to sql: What are the ids and names of the companies that operated more than one flight? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select operate_company.id , operate_company.name from operate_company join flight on operate_company.id = flight.company_id group by operate_company.id having count ( * ) > 1

### Instruction:

Convert text to sql: What is the id, name and IATA code of the airport that had most number of flights? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select airport.id , airport.name , airport.iata from airport join flight on airport.id = flight.airport_id group by flight.id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select distinct flight.pilot from airport join flight on airport.id = flight.airport_id where airport.country = 'United States' or airport.name = 'Billund Airport'

### Instruction:

Convert text to sql: What is the most common company type, and how many are there? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select type , count ( * ) from operate_company group by type order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: How many airports haven't the pilot 'Thompson' driven an aircraft? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select count ( * ) from airport where id not in ( select airport_id from flight where pilot = 'Thompson' )

### Instruction:

Convert text to sql: List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities. | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select flight.pilot from operate_company join flight on operate_company.id = flight.company_id where operate_company.principal_activities = 'Cargo' intersect select flight.pilot from operate_company join flight on operate_company.id = flight.company_id where operate_company.principal_activities = 'Catering services'

### Instruction:

Convert text to sql: Which of the airport names contains the word 'international'? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select name from airport where name like '%international%'
### Instruction:

Convert text to sql: How many companies operates airlines in each airport? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select airport.id , count ( * ) from operate_company join flight on operate_company.id = flight.company_id join airport on flight.airport_id = airport.id group by airport.id

### Instruction:

Convert text to sql: how many airports are there in each country? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select count ( * ) , country from airport group by country

### Instruction:

Convert text to sql: which countries have more than 2 airports? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select country from airport group by country having count ( * ) > 2

### Instruction:

Convert text to sql: which pilot is in charge of the most number of flights? | airport : id , city , country , iata , icao , name | operate_company : id , name , type , principal_activities , incorporated_in , group_equity_shareholding | flight : id , vehicle_flight_number , date , pilot , velocity , altitude , airport_id , company_id | flight.company_id = operate_company.id | flight.airport_id = airport.id | 

### Response:

select pilot from flight group by pilot order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: How many accounts do we have? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select count ( * ) from accounts

### Instruction:

Convert text to sql: Count the number of accounts. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select count ( * ) from accounts

### Instruction:

Convert text to sql: Show all account ids and account details. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select account_id , account_details from accounts
### Instruction:

Convert text to sql: What are the ids and details of all accounts? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select account_id , account_details from accounts

### Instruction:

Convert text to sql: How many statements do we have? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select count ( * ) from statements

### Instruction:

Convert text to sql: Count the number of statements. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select count ( * ) from statements
### Instruction:

Convert text to sql: List all statement ids and statement details. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select statement_id , statement_details from statements

### Instruction:

Convert text to sql: What are the ids and details of all statements? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select statement_id , statement_details from statements
### Instruction:

Convert text to sql: Show statement id, statement detail, account detail for accounts. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select accounts.statement_id , statements.statement_details , accounts.account_details from accounts join statements on accounts.statement_id = statements.statement_id

### Instruction:

Convert text to sql: What are the statement ids, statement details, and account details, for all accounts? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select accounts.statement_id , statements.statement_details , accounts.account_details from accounts join statements on accounts.statement_id = statements.statement_id
### Instruction:

Convert text to sql: Show all statement id and the number of accounts for each statement. | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select statement_id , count ( * ) from accounts group by statement_id

### Instruction:

Convert text to sql: What are the different statement ids on accounts, and the number of accounts for each? | ref_document_types : document_type_code , document_type_name , document_type_description | ref_budget_codes : budget_type_code , budget_type_description | projects : project_id , project_details | documents : document_id , document_type_code , project_id , document_date , document_name , document_description , other_details | statements : statement_id , statement_details | documents_with_expenses : document_id , budget_type_code , document_details | accounts : account_id , statement_id , account_details | documents.project_id = projects.project_id | documents.document_type_code = ref_document_types.document_type_code | statements.statement_id = documents.document_id | documents_with_expenses.document_id = documents.document_id | documents_with_expenses.budget_type_code = ref_budget_codes.budget_type_code | accounts.statement_id = statements.statement_id | 

### Response:

select statement_id , count ( * ) from accounts group by statement_id