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

Convert text to sql: what are the event details of the services that have the type code 'Marriage'? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select events.event_details from events join services on events.service_id = services.service_id where services.service_type_code = 'Marriage'

### Instruction:

Convert text to sql: What are the ids and details of events that have more than one participants? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select events.event_id , events.event_details from events join participants_in_events on events.event_id = participants_in_events.event_id group by events.event_id having count ( * ) > 1

### Instruction:

Convert text to sql: How many events have each participants attended? List the participant id, type and the number. | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select participants.participant_id , participants.participant_type_code , count ( * ) from participants join participants_in_events on participants.participant_id = participants_in_events.participant_id group by participants.participant_id

### Instruction:

Convert text to sql: What are all the the participant ids, type code and details? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select participant_id , participant_type_code , participant_details from participants
### Instruction:

Convert text to sql: How many participants belong to the type 'Organizer'? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select count ( * ) from participants where participant_type_code = 'Organizer'

### Instruction:

Convert text to sql: List the type of the services in alphabetical order. | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select service_type_code from services order by service_type_code asc

### Instruction:

Convert text to sql: List the service id and details for the events. | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select service_id , event_details from events

### Instruction:

Convert text to sql: How many events had participants whose details had the substring 'Dr.' | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select count ( * ) from participants join participants_in_events on participants.participant_id = participants_in_events.participant_id where participants.participant_details like '%Dr.%'

### Instruction:

Convert text to sql: What is the most common participant type? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select participant_type_code from participants group by participant_type_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Which service id and type has the least number of participants? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select events.service_id , services.service_type_code from participants join participants_in_events on participants.participant_id = participants_in_events.participant_id join events on participants_in_events.event_id = events.event_id join services on events.service_id = services.service_id group by events.service_id order by count ( * ) asc limit 1

### Instruction:

Convert text to sql: What is the id of the event with the most participants? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select event_id from participants_in_events group by event_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which events id does not have any participant with detail 'Kenyatta Kuhn'? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select event_id from events except select participants_in_events.event_id from participants_in_events join participants on participants_in_events.participant_id = participants.participant_id where participant_details = 'Kenyatta Kuhn'

### Instruction:

Convert text to sql: Which services type had both successful and failure event details? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select services.service_type_code from services join events on services.service_id = events.service_id where events.event_details = 'Success' intersect select services.service_type_code from services join events on services.service_id = events.service_id where events.event_details = 'Fail'
### Instruction:

Convert text to sql: How many events did not have any participants? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select count ( * ) from events where event_id not in ( select event_id from participants_in_events )

### Instruction:

Convert text to sql: What are all the distinct participant ids who attended any events? | services : service_id , service_type_code | participants : participant_id , participant_type_code , participant_details | events : event_id , service_id , event_details | participants_in_events : event_id , participant_id | events.service_id = services.service_id | participants_in_events.event_id = events.event_id | participants_in_events.participant_id = participants.participant_id | 

### Response:

select count ( distinct participant_id ) from participants_in_events
### Instruction:

Convert text to sql: What is the name of the race held most recently? | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select name from races order by date desc limit 1
### Instruction:

Convert text to sql: What is the name of the race that occurred most recently? | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select name from races order by date desc limit 1
### Instruction:

Convert text to sql: What is the name and date of the most recent race? | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select name , date from races order by date desc limit 1
### Instruction:

Convert text to sql: What is the name and date of the race that occurred most recently? | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select name , date from races order by date desc limit 1
### Instruction:

Convert text to sql: Find the names of all races held in 2017. | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select name from races where year = 2017
### Instruction:

Convert text to sql: What are the names of all the races that occurred in the year 2017? | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select name from races where year = 2017
### Instruction:

Convert text to sql: Find the distinct names of all races held between 2014 and 2017? | circuits : circuitid , circuitref , name , location , country , lat , lng , alt , url | races : raceid , year , round , circuitid , name , date , time , url | drivers : driverid , driverref , number , code , forename , surname , dob , nationality , url | status : statusid , status | seasons : year , url | constructors : constructorid , constructorref , name , nationality , url | constructorstandings : constructorstandingsid , raceid , constructorid , points , position , positiontext , wins | results : resultid , raceid , driverid , constructorid , number , grid , position , positiontext , positionorder , points , laps , time , milliseconds , fastestlap , rank , fastestlaptime , fastestlapspeed , statusid | driverstandings : driverstandingsid , raceid , driverid , points , position , positiontext , wins | constructorresults : constructorresultsid , raceid , constructorid , points , status | qualifying : qualifyid , raceid , driverid , constructorid , number , position , q1 , q2 , q3 | pitstops : raceid , driverid , stop , lap , time , duration , milliseconds | laptimes : raceid , driverid , lap , position , time , milliseconds | races.circuitid = circuits.circuitid | constructorstandings.raceid = races.raceid | constructorstandings.constructorid = constructors.constructorid | results.driverid = drivers.driverid | results.raceid = races.raceid | results.constructorid = constructors.constructorid | driverstandings.driverid = drivers.driverid | driverstandings.raceid = races.raceid | constructorresults.raceid = races.raceid | constructorresults.constructorid = constructors.constructorid | qualifying.driverid = drivers.driverid | qualifying.raceid = races.raceid | qualifying.constructorid = constructors.constructorid | pitstops.driverid = drivers.driverid | pitstops.raceid = races.raceid | laptimes.driverid = drivers.driverid | laptimes.raceid = races.raceid | 

### Response:

select distinct name from races where year between 2014 and 2017