db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
baseball_1
select sum(t1.games) from home_game as t1 join team as t2 on t1.team_id = t2.team_id_br where t2.name = 'boston red stockings' and t1.year between 1990 and 2000;
Question: count the total number of games the team boston red stockings attended from 1990 to 2000. | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf,...
count the total number of games the team boston red stockings attended from 1990 to 2000.
baseball_1
select t2.name from home_game as t1 join team as t2 on t1.team_id = t2.team_id_br where t1.year = 1980 order by t1.attendance asc limit 1;
Question: which team had the least number of attendances in home games in 1980? | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g...
which team had the least number of attendances in home games in 1980?
baseball_1
select t2.name from home_game as t1 join team as t2 on t1.team_id = t2.team_id_br where t1.year = 1980 order by t1.attendance asc limit 1;
Question: find the team that attended the least number of home games in 1980. | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_d...
find the team that attended the least number of home games in 1980.
baseball_1
select state from park group by state having count(*) > 2;
Question: list the names of states that have more than 2 parks. | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph, g_pr....
list the names of states that have more than 2 parks.
baseball_1
select state from park group by state having count(*) > 2;
Question: which states have more than 2 parks? | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph, g_pr. manager_award ->...
which states have more than 2 parks?
baseball_1
select count(*) from team_franchise where active = 'y';
Question: how many team franchises are active, with active value 'y'? | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph,...
how many team franchises are active, with active value 'y'?
baseball_1
select count(*) from team_franchise where active = 'y';
Question: find the number of team franchises that are active (have 'y' as 'active' information). | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_...
find the number of team franchises that are active (have 'y' as 'active' information).
baseball_1
select city from park group by city having count(*) between 2 and 4;
Question: which cities have 2 to 4 parks? | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph, g_pr. manager_award -> play...
which cities have 2 to 4 parks?
baseball_1
select city from park group by city having count(*) between 2 and 4;
Question: find all the cities that have 2 to 4 parks. | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph, g_pr. manager_a...
find all the cities that have 2 to 4 parks.
baseball_1
select t2.park_name from home_game as t1 join park as t2 on t1.park_id = t2.park_id where t1.year = 2008 order by t1.attendance desc limit 1;
Question: which park had most attendances in 2008? | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph, g_pr. manager_awar...
which park had most attendances in 2008?
baseball_1
select t2.park_name from home_game as t1 join park as t2 on t1.park_id = t2.park_id where t1.year = 2008 order by t1.attendance desc limit 1;
Question: which park did the most people attend in 2008? | Tables: all_star -> player_id, year, game_num, game_id, team_id, league_id, gp, starting_pos. appearances -> year, team_id, league_id, player_id, g_all, gs, g_batting, g_defense, g_p, g_c, g_1b, g_2b, g_3b, g_ss, g_lf, g_cf, g_rf, g_of, g_dh, g_ph, g_pr. manage...
which park did the most people attend in 2008?
mountain_photos
select count(*) from camera_lens where focal_length_mm > 15
Question: how many camera lenses have a focal length longer than 15 mm? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens...
how many camera lenses have a focal length longer than 15 mm?
mountain_photos
select brand , name from camera_lens order by max_aperture desc
Question: find the brand and name for each camera lens, and sort in descending order of maximum aperture. | Tables: 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. | Joins: photos.mountain_id...
find the brand and name for each camera lens, and sort in descending order of maximum aperture.
mountain_photos
select id , color , name from photos
Question: list the id, color scheme, and name for all the photos. | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens_id = ...
list the id, color scheme, and name for all the photos.
mountain_photos
select max(height) , avg(height) from mountain
Question: what are the maximum and average height of the mountains? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens_id ...
what are the maximum and average height of the mountains?
mountain_photos
select avg(prominence) from mountain where country = 'morocco'
Question: what are the average prominence of the mountains in country 'morocco'? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.ca...
what are the average prominence of the mountains in country 'morocco'?
mountain_photos
select name , height , prominence from mountain where range != 'aberdare range'
Question: what are the name, height and prominence of mountains which do not belong to the range 'aberdare range'? | Tables: 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. | Joins: photos.mo...
what are the name, height and prominence of mountains which do not belong to the range 'aberdare range'?
mountain_photos
select t1.id , t1.name from mountain as t1 join photos as t2 on t1.id = t2.mountain_id where t1.height > 4000
Question: what are the id and name of the photos for mountains? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens_id = ca...
what are the id and name of the photos for mountains?
mountain_photos
select t1.id , t1.name from mountain as t1 join photos as t2 on t1.id = t2.mountain_id group by t1.id having count(*) >= 2
Question: what are the id and name of the mountains that have at least 2 photos? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.ca...
what are the id and name of the mountains that have at least 2 photos?
mountain_photos
select t2.name from photos as t1 join camera_lens as t2 on t1.camera_lens_id = t2.id group by t2.id order by count(*) desc limit 1
Question: what are the names of the cameras that have taken picture of the most mountains? | Tables: 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. | Joins: photos.mountain_id = mountain.id,...
what are the names of the cameras that have taken picture of the most mountains?
mountain_photos
select t1.name from camera_lens as t1 join photos as t2 on t2.camera_lens_id = t1.id where t1.brand = 'sigma' or t1.brand = 'olympus'
Question: what are the names of photos taken with the lens brand 'sigma' or 'olympus'? | Tables: 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. | Joins: photos.mountain_id = mountain.id, pho...
what are the names of photos taken with the lens brand 'sigma' or 'olympus'?
mountain_photos
select count(distinct brand) from camera_lens
Question: how many different kinds of lens brands are there? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens_id = camer...
how many different kinds of lens brands are there?
mountain_photos
select count(*) from camera_lens where id not in ( select camera_lens_id from photos )
Question: how many camera lenses are not used in taking any photos? | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens_id ...
how many camera lenses are not used in taking any photos?
mountain_photos
select count(distinct t2.camera_lens_id) from mountain as t1 join photos as t2 on t1.id = t2.mountain_id where t1.country = 'ethiopia'
Question: how many distinct kinds of camera lenses are used to take photos of mountains in the country 'ethiopia'? | Tables: 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. | Joins: photos.mo...
how many distinct kinds of camera lenses are used to take photos of mountains in the country 'ethiopia'?
mountain_photos
select t3.brand from mountain as t1 join photos as t2 on t1.id = t2.mountain_id join camera_lens as t3 on t2.camera_lens_id = t3.id where t1.range = 'toubkal atlas' intersect select t3.brand from mountain as t1 join photos as t2 on t1.id = t2.mountain_id join camera_lens as t3 on t2.camera_lens_id = t3.id whe...
Question: 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' | Tables: mountain -> id, name, Height, Prominence, Range, Country. camera_lens -> id, brand, name, focal_length_mm, max_aperture. photos -> id, camera_lens_id, mount...
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_photos
select name , prominence from mountain except select t1.name , t1.prominence from mountain as t1 join photos as t2 on t1.id = t2.mountain_id join camera_lens as t3 on t2.camera_lens_id = t3.id where t3.brand = 'sigma'
Question: show the name and prominence of the mountains whose picture is not taken by a lens of brand 'sigma'. | Tables: 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. | Joins: photos.mounta...
show the name and prominence of the mountains whose picture is not taken by a lens of brand 'sigma'.
mountain_photos
select name from camera_lens where name like '%digital%'
Question: list the camera lens names containing substring 'digital'. | Tables: 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. | Joins: photos.mountain_id = mountain.id, photos.camera_lens_id...
list the camera lens names containing substring 'digital'.
mountain_photos
select t1.name , count(*) from camera_lens as t1 join photos as t2 on t1.id = t2.camera_lens_id group by t1.id order by count(*)
Question: what is the name of each camera lens and the number of photos taken by it? order the result by the count of photos. | Tables: 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. | Joins...
what is the name of each camera lens and the number of photos taken by it? order the result by the count of photos.
program_share
select name from channel where owner != 'cctv'
Question: find the names of channels that are not owned by cctv. | Tables: 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. | J...
find the names of channels that are not owned by cctv.
program_share
select name from channel where owner != 'cctv'
Question: which channels are not owned by cctv? give me the channel names. | Tables: 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_pe...
which channels are not owned by cctv? give me the channel names.
program_share
select name from channel order by rating_in_percent desc
Question: list all channel names ordered by their rating in percent from big to small. | Tables: 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,...
list all channel names ordered by their rating in percent from big to small.
program_share
select name from channel order by rating_in_percent desc
Question: give me a list of all the channel names sorted by the channel rating in descending order. | Tables: 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, Prog...
give me a list of all the channel names sorted by the channel rating in descending order.
program_share
select owner from channel order by rating_in_percent desc limit 1
Question: what is the owner of the channel that has the highest rating ratio? | Tables: 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...
what is the owner of the channel that has the highest rating ratio?
program_share
select owner from channel order by rating_in_percent desc limit 1
Question: show me the owner of the channel with the highest rating. | Tables: 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. ...
show me the owner of the channel with the highest rating.
program_share
select count(*) from program
Question: how many programs are there? | Tables: 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. | Joins: broadcast.Program_ID...
how many programs are there?
program_share
select count(*) from program
Question: count the number of programs. | Tables: 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. | Joins: broadcast.Program_I...
count the number of programs.
program_share
select name from program order by launch
Question: list all the names of programs, ordering by launch time. | Tables: 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. |...
list all the names of programs, ordering by launch time.
program_share
select name from program order by launch
Question: what is the list of program names, sorted by the order of launch date? | Tables: 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...
what is the list of program names, sorted by the order of launch date?
program_share
select name , origin , owner from program
Question: list the name, origin and owner of each program. | Tables: 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. | Joins: ...
list the name, origin and owner of each program.
program_share
select name , origin , owner from program
Question: what are the name, origin and owner of each program? | Tables: 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. | Joi...
what are the name, origin and owner of each program?
program_share
select name from program order by launch desc limit 1
Question: find the name of the program that was launched most recently. | Tables: 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_perce...
find the name of the program that was launched most recently.
program_share
select name from program order by launch desc limit 1
Question: which program was launched most recently? return the program name. | Tables: 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_...
which program was launched most recently? return the program name.
program_share
select sum(share_in_percent) from channel where owner = 'cctv'
Question: find the total percentage share of all channels owned by cctv. | Tables: 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_perc...
find the total percentage share of all channels owned by cctv.
program_share
select sum(share_in_percent) from channel where owner = 'cctv'
Question: what is the total share (in percent) of all the channels owned by cctv? | Tables: 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, Shar...
what is the total share (in percent) of all the channels owned by cctv?
program_share
select t1.name from channel as t1 join broadcast as t2 on t1.channel_id = t2.channel_id where t2.time_of_day = 'morning'
Question: find the names of the channels that are broadcast in the morning. | Tables: 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_p...
find the names of the channels that are broadcast in the morning.
program_share
select t1.name from channel as t1 join broadcast as t2 on t1.channel_id = t2.channel_id where t2.time_of_day = 'morning'
Question: which channels are broadcast in the morning? give me the channel names. | Tables: 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, Shar...
which channels are broadcast in the morning? give me the channel names.
program_share
select t1.name from channel as t1 join broadcast as t2 on t1.channel_id = t2.channel_id where t2.time_of_day = 'morning' intersect select t1.name from channel as t1 join broadcast as t2 on t1.channel_id = t2.channel_id where t2.time_of_day = 'night'
Question: what are the names of the channels that broadcast in both morning and night? | Tables: 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,...
what are the names of the channels that broadcast in both morning and night?
program_share
select t1.name from channel as t1 join broadcast as t2 on t1.channel_id = t2.channel_id where t2.time_of_day = 'morning' intersect select t1.name from channel as t1 join broadcast as t2 on t1.channel_id = t2.channel_id where t2.time_of_day = 'night'
Question: which channels broadcast both in the morning and at night? give me the channel names. | Tables: 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_...
which channels broadcast both in the morning and at night? give me the channel names.
program_share
select count(*) , time_of_day from broadcast group by time_of_day
Question: how many programs are broadcast in each time section of the day? | Tables: 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_pe...
how many programs are broadcast in each time section of the day?
program_share
select count(*) , time_of_day from broadcast group by time_of_day
Question: count the number of programs broadcast for each time section of a day. | Tables: 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...
count the number of programs broadcast for each time section of a day.
program_share
select count(distinct program_id) from broadcast where time_of_day = 'night'
Question: find the number of different programs that are broadcast during night time. | Tables: 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, ...
find the number of different programs that are broadcast during night time.
program_share
select count(distinct program_id) from broadcast where time_of_day = 'night'
Question: how many distinct programs are broadcast at 'night' time? | Tables: 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. ...
how many distinct programs are broadcast at 'night' time?
program_share
select name from program except select t1.name from program as t1 join broadcast as t2 on t1.program_id = t2.program_id where t2.time_of_day = 'morning'
Question: find the names of programs that are never broadcasted in the morning. | Tables: 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_...
find the names of programs that are never broadcasted in the morning.
program_share
select name from program except select t1.name from program as t1 join broadcast as t2 on t1.program_id = t2.program_id where t2.time_of_day = 'morning'
Question: which programs are never broadcasted in the morning? give me the names of the programs. | Tables: 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, Progra...
which programs are never broadcasted in the morning? give me the names of the programs.
program_share
select t1.owner from program as t1 join broadcast as t2 on t1.program_id = t2.program_id where t2.time_of_day = 'morning' intersect select t1.owner from program as t1 join broadcast as t2 on t1.program_id = t2.program_id where t2.time_of_day = 'night'
Question: find the program owners that have some programs in both morning and night time. | Tables: 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, Da...
find the program owners that have some programs in both morning and night time.
program_share
select t1.owner from program as t1 join broadcast as t2 on t1.program_id = t2.program_id where t2.time_of_day = 'morning' intersect select t1.owner from program as t1 join broadcast as t2 on t1.program_id = t2.program_id where t2.time_of_day = 'night'
Question: who are the owners of the programs that broadcast both in the morning and at night? | Tables: 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...
who are the owners of the programs that broadcast both in the morning and at night?
program_share
select origin from program order by origin
Question: list all program origins in the alphabetical order. | Tables: 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. | Join...
list all program origins in the alphabetical order.
program_share
select origin from program order by origin
Question: what is the list of program origins ordered alphabetically? | Tables: 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...
what is the list of program origins ordered alphabetically?
program_share
select count(distinct owner) from channel
Question: what is the number of different channel owners? | Tables: 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. | Joins: b...
what is the number of different channel owners?
program_share
select count(distinct owner) from channel
Question: count the number of distinct channel owners. | Tables: 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. | Joins: broa...
count the number of distinct channel owners.
program_share
select name from program where origin != 'beijing'
Question: find the names of programs whose origin is not in beijing. | Tables: 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....
find the names of programs whose origin is not in beijing.
program_share
select name from program where origin != 'beijing'
Question: which programs' origins are not 'beijing'? give me the program names. | Tables: 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_...
which programs' origins are not 'beijing'? give me the program names.
program_share
select name from channel where owner = 'cctv' or owner = 'hbs'
Question: what are the names of the channels owned by cctv or hbs? | Tables: 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. |...
what are the names of the channels owned by cctv or hbs?
program_share
select name from channel where owner = 'cctv' or owner = 'hbs'
Question: list the names of all the channels owned by either cctv or hbs | Tables: 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_perc...
list the names of all the channels owned by either cctv or hbs
program_share
select sum(rating_in_percent) , owner from channel group by owner
Question: find the total rating ratio for each channel owner. | Tables: 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. | Join...
find the total rating ratio for each channel owner.
program_share
select sum(rating_in_percent) , owner from channel group by owner
Question: what is the total rating of channel for each channel owner? | Tables: 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...
what is the total rating of channel for each channel owner?
program_share
select t1.name from program as t1 join broadcast as t2 on t1.program_id = t2.program_id group by t2.program_id order by count(*) desc limit 1
Question: find the name of the program that is broadcast most frequently. | Tables: 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_per...
find the name of the program that is broadcast most frequently.
program_share
select t1.name from program as t1 join broadcast as t2 on t1.program_id = t2.program_id group by t2.program_id order by count(*) desc limit 1
Question: which program is broadcast most frequently? give me the program name. | Tables: 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_...
which program is broadcast most frequently? give me the program name.
e_learning
select count(*) from courses
Question: how many courses are there in total? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_name, middle_nam...
how many courses are there in total?
e_learning
select count(*) from courses
Question: find the total number of courses offered. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_name, middl...
find the total number of courses offered.
e_learning
select course_description from courses where course_name = 'database'
Question: what are the descriptions of the courses with name 'database'? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password,...
what are the descriptions of the courses with name 'database'?
e_learning
select course_description from courses where course_name = 'database'
Question: return the description for the courses named 'database'. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, perso...
return the description for the courses named 'database'.
e_learning
select address_line_1 from course_authors_and_tutors where personal_name = 'cathrine'
Question: what are the addresses of the course authors or tutors with personal name 'cathrine' | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon,...
what are the addresses of the course authors or tutors with personal name 'cathrine'
e_learning
select address_line_1 from course_authors_and_tutors where personal_name = 'cathrine'
Question: return the addresses of the course authors or tutors whose personal name is 'cathrine'. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_log...
return the addresses of the course authors or tutors whose personal name is 'cathrine'.
e_learning
select address_line_1 from course_authors_and_tutors
Question: list the addresses of all the course authors or tutors. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, person...
list the addresses of all the course authors or tutors.
e_learning
select address_line_1 from course_authors_and_tutors
Question: what is the address of each course author or tutor? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_n...
what is the address of each course author or tutor?
e_learning
select login_name , family_name from course_authors_and_tutors
Question: list all the login names and family names of course author and tutors. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, p...
list all the login names and family names of course author and tutors.
e_learning
select login_name , family_name from course_authors_and_tutors
Question: what are the login names and family names of course author and tutors? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, p...
what are the login names and family names of course author and tutors?
e_learning
select date_of_enrolment , date_of_completion from student_course_enrolment
Question: list all the dates of enrollment and completion of students. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, p...
list all the dates of enrollment and completion of students.
e_learning
select date_of_enrolment , date_of_completion from student_course_enrolment
Question: what are all the dates of enrollment and completion in record? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password,...
what are all the dates of enrollment and completion in record?
e_learning
select count(distinct student_id) from student_course_enrolment
Question: how many distinct students are enrolled in courses? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_n...
how many distinct students are enrolled in courses?
e_learning
select count(distinct student_id) from student_course_enrolment
Question: find the number of distinct students enrolled in courses. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, pers...
find the number of distinct students enrolled in courses.
e_learning
select count(course_id) from student_course_enrolment
Question: how many distinct courses are enrolled in by students? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, persona...
how many distinct courses are enrolled in by students?
e_learning
select count(course_id) from student_course_enrolment
Question: find the number of distinct courses that have enrolled students. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, passwor...
find the number of distinct courses that have enrolled students.
e_learning
select date_test_taken from student_tests_taken where test_result = 'pass'
Question: find the dates of the tests taken with result 'pass'. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal...
find the dates of the tests taken with result 'pass'.
e_learning
select date_test_taken from student_tests_taken where test_result = 'pass'
Question: which tests have 'pass' results? return the dates when the tests were taken. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_n...
which tests have 'pass' results? return the dates when the tests were taken.
e_learning
select count(*) from student_tests_taken where test_result = 'fail'
Question: how many tests have result 'fail'? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_name, middle_name,...
how many tests have result 'fail'?
e_learning
select count(*) from student_tests_taken where test_result = 'fail'
Question: count the number of tests with 'fail' result. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_name, m...
count the number of tests with 'fail' result.
e_learning
select login_name from students where family_name = 'ward'
Question: what are the login names of the students with family name 'ward'? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, passwo...
what are the login names of the students with family name 'ward'?
e_learning
select login_name from students where family_name = 'ward'
Question: return the login names of the students whose family name is 'ward'. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, pass...
return the login names of the students whose family name is 'ward'.
e_learning
select date_of_latest_logon from students where family_name = 'jaskolski' or family_name = 'langosh'
Question: what are the dates of the latest logon of the students with family name 'jaskolski' or 'langosh'? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_...
what are the dates of the latest logon of the students with family name 'jaskolski' or 'langosh'?
e_learning
select date_of_latest_logon from students where family_name = 'jaskolski' or family_name = 'langosh'
Question: find the latest logon date of the students whose family name is 'jaskolski' or 'langosh'. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_l...
find the latest logon date of the students whose family name is 'jaskolski' or 'langosh'.
e_learning
select count(*) from students where personal_name like '%son%'
Question: how many students have personal names that contain the word 'son'? | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, passw...
how many students have personal names that contain the word 'son'?
e_learning
select count(*) from students where personal_name like '%son%'
Question: find the number of students who have the word 'son' in their personal names. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_n...
find the number of students who have the word 'son' in their personal names.
e_learning
select subject_name from subjects
Question: list all the subject names. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_name, middle_name, family...
list all the subject names.
e_learning
select subject_name from subjects
Question: what are the names of all the subjects. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_latest_logon, login_name, password, personal_name, middle_...
what are the names of all the subjects.
e_learning
select * from course_authors_and_tutors order by personal_name
Question: list all the information about course authors and tutors in alphabetical order of the personal name. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_...
list all the information about course authors and tutors in alphabetical order of the personal name.
e_learning
select * from course_authors_and_tutors order by personal_name
Question: sort the information about course authors and tutors in alphabetical order of the personal name. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of_l...
sort the information about course authors and tutors in alphabetical order of the personal name.
e_learning
select personal_name , family_name from students order by family_name
Question: list the personal names and family names of all the students in alphabetical order of family name. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_registration, date_of...
list the personal names and family names of all the students in alphabetical order of family name.
e_learning
select personal_name , family_name from students order by family_name
Question: what are the personal names and family names of the students? sort the result in alphabetical order of the family name. | Tables: Course_Authors_and_Tutors -> author_id, author_tutor_ATB, login_name, password, personal_name, middle_name, family_name, gender_mf, address_line_1. Students -> student_id, date_of_...
what are the personal names and family names of the students? sort the result in alphabetical order of the family name.