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

Convert text to sql: How many camera lenses have a focal length longer than 15 mm? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select count ( * ) from camera_lens where focal_length_mm > 15

### Instruction:

Convert text to sql: Find the brand and name for each camera lens, and sort in descending order of maximum aperture. | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select brand , name from camera_lens order by max_aperture desc

### Instruction:

Convert text to sql: List the id, color scheme, and name for all the photos. | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select id , color , name from photos

### Instruction:

Convert text to sql: What are the maximum and average height of the mountains? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select max ( height ) , avg ( height ) from mountain

### Instruction:

Convert text to sql: What are the average prominence of the mountains in country 'Morocco'? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select avg ( prominence ) from mountain where country = 'Morocco'

### Instruction:

Convert text to sql: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select name , height , prominence from mountain where range != 'Aberdare Range'
### Instruction:

Convert text to sql: What are the id and name of the photos for mountains? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select mountain.id , mountain.name from mountain join photos on mountain.id = photos.mountain_id where mountain.height > 4000

### Instruction:

Convert text to sql: What are the id and name of the mountains that have at least 2 photos? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select mountain.id , mountain.name from mountain join photos on mountain.id = photos.mountain_id group by mountain.id having count ( * ) >= 2

### Instruction:

Convert text to sql: What are the names of the cameras that have taken picture of the most mountains? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select camera_lens.name from photos join camera_lens on photos.camera_lens_id = camera_lens.id group by camera_lens.id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select camera_lens.name from camera_lens join photos on photos.camera_lens_id = camera_lens.id where camera_lens.brand = 'Sigma' or camera_lens.brand = 'Olympus'

### Instruction:

Convert text to sql: How many different kinds of lens brands are there? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select count ( distinct brand ) from camera_lens

### Instruction:

Convert text to sql: How many camera lenses are not used in taking any photos? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select count ( * ) from camera_lens where id not in ( select camera_lens_id from photos )
### Instruction:

Convert text to sql: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'? | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select count ( distinct photos.camera_lens_id ) from mountain join photos on mountain.id = photos.mountain_id where mountain.country = 'Ethiopia'

### Instruction:

Convert text to sql: List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif' | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select camera_lens.brand from mountain join photos on mountain.id = photos.mountain_id join camera_lens on photos.camera_lens_id = camera_lens.id where mountain.range = 'Toubkal Atlas' intersect select camera_lens.brand from mountain join photos on mountain.id = photos.mountain_id join camera_lens on photos.camera_lens_id = camera_lens.id where mountain.range = 'Lasta Massif'

### Instruction:

Convert text to sql: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'. | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select name , prominence from mountain except select mountain.name , mountain.prominence from mountain join photos on mountain.id = photos.mountain_id join camera_lens on photos.camera_lens_id = camera_lens.id where camera_lens.brand = 'Sigma'

### Instruction:

Convert text to sql: List the camera lens names containing substring "Digital". | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select name from camera_lens where name like '%Digital%'

### Instruction:

Convert text to sql: What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos. | mountain : id , name , height , prominence , range , country | camera_lens : id , brand , name , focal_length_mm , max_aperture | photos : id , camera_lens_id , mountain_id , color , name | photos.mountain_id = mountain.id | photos.camera_lens_id = camera_lens.id | 

### Response:

select camera_lens.name , count ( * ) from camera_lens join photos on camera_lens.id = photos.camera_lens_id group by camera_lens.id order by count ( * ) asc
### Instruction:

Convert text to sql: Find the names of channels that are not owned by CCTV. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from channel where owner != 'CCTV'

### Instruction:

Convert text to sql: Which channels are not owned by CCTV? Give me the channel names. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from channel where owner != 'CCTV'

### Instruction:

Convert text to sql: List all channel names ordered by their rating in percent from big to small. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from channel order by rating_in_percent desc

### Instruction:

Convert text to sql: Give me a list of all the channel names sorted by the channel rating in descending order. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from channel order by rating_in_percent desc

### Instruction:

Convert text to sql: What is the owner of the channel that has the highest rating ratio? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select owner from channel order by rating_in_percent desc limit 1
### Instruction:

Convert text to sql: Show me the owner of the channel with the highest rating. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select owner from channel order by rating_in_percent desc limit 1

### Instruction:

Convert text to sql: how many programs are there? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select count ( * ) from program

### Instruction:

Convert text to sql: Count the number of programs. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select count ( * ) from program

### Instruction:

Convert text to sql: list all the names of programs, ordering by launch time. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from program order by launch asc

### Instruction:

Convert text to sql: What is the list of program names, sorted by the order of launch date? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from program order by launch asc
### Instruction:

Convert text to sql: List the name, origin and owner of each program. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name , origin , owner from program

### Instruction:

Convert text to sql: What are the name, origin and owner of each program? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name , origin , owner from program

### Instruction:

Convert text to sql: find the name of the program that was launched most recently. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from program order by launch desc limit 1

### Instruction:

Convert text to sql: Which program was launched most recently? Return the program name. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select name from program order by launch desc limit 1

### Instruction:

Convert text to sql: find the total percentage share of all channels owned by CCTV. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select sum ( share_in_percent ) from channel where owner = 'CCTV'
### Instruction:

Convert text to sql: What is the total share (in percent) of all the channels owned by CCTV? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select sum ( share_in_percent ) from channel where owner = 'CCTV'

### Instruction:

Convert text to sql: Find the names of the channels that are broadcast in the morning. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select channel.name from channel join broadcast on channel.channel_id = broadcast.channel_id where broadcast.time_of_day = 'Morning'

### Instruction:

Convert text to sql: Which channels are broadcast in the morning? Give me the channel names. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select channel.name from channel join broadcast on channel.channel_id = broadcast.channel_id where broadcast.time_of_day = 'Morning'

### Instruction:

Convert text to sql: what are the names of the channels that broadcast in both morning and night? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select channel.name from channel join broadcast on channel.channel_id = broadcast.channel_id where broadcast.time_of_day = 'Morning' intersect select channel.name from channel join broadcast on channel.channel_id = broadcast.channel_id where broadcast.time_of_day = 'Night'
### Instruction:

Convert text to sql: Which channels broadcast both in the morning and at night? Give me the channel names. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select channel.name from channel join broadcast on channel.channel_id = broadcast.channel_id where broadcast.time_of_day = 'Morning' intersect select channel.name from channel join broadcast on channel.channel_id = broadcast.channel_id where broadcast.time_of_day = 'Night'

### Instruction:

Convert text to sql: how many programs are broadcast in each time section of the day? | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select count ( * ) , time_of_day from broadcast group by time_of_day

### Instruction:

Convert text to sql: Count the number of programs broadcast for each time section of a day. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select count ( * ) , time_of_day from broadcast group by time_of_day

### Instruction:

Convert text to sql: find the number of different programs that are broadcast during night time. | program : program_id , name , origin , launch , owner | channel : channel_id , name , owner , share_in_percent , rating_in_percent | broadcast : channel_id , program_id , time_of_day | broadcast_share : channel_id , program_id , date , share_in_percent | broadcast.program_id = program.program_id | broadcast.channel_id = channel.channel_id | broadcast_share.program_id = program.program_id | broadcast_share.channel_id = channel.channel_id | 

### Response:

select count ( distinct program_id ) from broadcast where time_of_day = 'Night'