messages
list
[ { "content": "Count the total number of games the team Boston Red Stockings attended from 1990 to 2000.", "role": "user" }, { "content": "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;", "role": "assistant" } ]
[ { "content": "Which team had the least number of attendances in home games in 1980?", "role": "user" }, { "content": "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;", "role": "assistant" } ]
[ { "content": "Find the team that attended the least number of home games in 1980.", "role": "user" }, { "content": "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;", "role": "assistant" } ]
[ { "content": "List the names of states that have more than 2 parks.", "role": "user" }, { "content": "SELECT state FROM park GROUP BY state HAVING count(*) > 2;", "role": "assistant" } ]
[ { "content": "Which states have more than 2 parks?", "role": "user" }, { "content": "SELECT state FROM park GROUP BY state HAVING count(*) > 2;", "role": "assistant" } ]
[ { "content": "How many team franchises are active, with active value 'Y'?", "role": "user" }, { "content": "SELECT count(*) FROM team_franchise WHERE active = 'Y';", "role": "assistant" } ]
[ { "content": "Find the number of team franchises that are active (have 'Y' as \"active\" information).", "role": "user" }, { "content": "SELECT count(*) FROM team_franchise WHERE active = 'Y';", "role": "assistant" } ]
[ { "content": "Which cities have 2 to 4 parks?", "role": "user" }, { "content": "SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;", "role": "assistant" } ]
[ { "content": "Find all the cities that have 2 to 4 parks.", "role": "user" }, { "content": "SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;", "role": "assistant" } ]
[ { "content": "Which park had most attendances in 2008?", "role": "user" }, { "content": "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;", "role": "assistant" } ]
[ { "content": "Which park did the most people attend in 2008?", "role": "user" }, { "content": "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;", "role": "assistant" } ]
[ { "content": "How many camera lenses have a focal length longer than 15 mm?", "role": "user" }, { "content": "SELECT count(*) FROM camera_lens WHERE focal_length_mm > 15", "role": "assistant" } ]
[ { "content": "Find the brand and name for each camera lens, and sort in descending order of maximum aperture.", "role": "user" }, { "content": "SELECT brand , name FROM camera_lens ORDER BY max_aperture DESC", "role": "assistant" } ]
[ { "content": "List the id, color scheme, and name for all the photos.", "role": "user" }, { "content": "SELECT id , color , name FROM photos", "role": "assistant" } ]
[ { "content": "What are the maximum and average height of the mountains?", "role": "user" }, { "content": "SELECT max(height) , avg(height) FROM mountain", "role": "assistant" } ]
[ { "content": "What are the average prominence of the mountains in country 'Morocco'?", "role": "user" }, { "content": "SELECT avg(prominence) FROM mountain WHERE country = 'Morocco'", "role": "assistant" } ]
[ { "content": "What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?", "role": "user" }, { "content": "SELECT name , height , prominence FROM mountain WHERE range != 'Aberdare Range'", "role": "assistant" } ]
[ { "content": "What are the id and name of the photos for mountains?", "role": "user" }, { "content": "SELECT T1.id , T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000", "role": "assistant" } ]
[ { "content": "What are the id and name of the mountains that have at least 2 photos?", "role": "user" }, { "content": "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", "role": "assistant" } ]
[ { "content": "What are the names of the cameras that have taken picture of the most mountains?", "role": "user" }, { "content": "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", "role": "assistant" } ]
[ { "content": "What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?", "role": "user" }, { "content": "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'", "role": "assistant" } ]
[ { "content": "How many different kinds of lens brands are there?", "role": "user" }, { "content": "SELECT count(DISTINCT brand) FROM camera_lens", "role": "assistant" } ]
[ { "content": "How many camera lenses are not used in taking any photos?", "role": "user" }, { "content": "SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )", "role": "assistant" } ]
[ { "content": "How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?", "role": "user" }, { "content": "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'", "role": "assistant" } ]
[ { "content": "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'", "role": "user" }, { "content": "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 WHERE T1.range = 'Lasta Massif'", "role": "assistant" } ]
[ { "content": "Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.", "role": "user" }, { "content": "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'", "role": "assistant" } ]
[ { "content": "List the camera lens names containing substring \"Digital\".", "role": "user" }, { "content": "SELECT name FROM camera_lens WHERE name LIKE \"%Digital%\"", "role": "assistant" } ]
[ { "content": "What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.", "role": "user" }, { "content": "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(*)", "role": "assistant" } ]
[ { "content": "Find the names of channels that are not owned by CCTV.", "role": "user" }, { "content": "SELECT name FROM channel WHERE OWNER != 'CCTV'", "role": "assistant" } ]
[ { "content": "Which channels are not owned by CCTV? Give me the channel names.", "role": "user" }, { "content": "SELECT name FROM channel WHERE OWNER != 'CCTV'", "role": "assistant" } ]
[ { "content": "List all channel names ordered by their rating in percent from big to small.", "role": "user" }, { "content": "SELECT name FROM channel ORDER BY rating_in_percent DESC", "role": "assistant" } ]
[ { "content": "Give me a list of all the channel names sorted by the channel rating in descending order.", "role": "user" }, { "content": "SELECT name FROM channel ORDER BY rating_in_percent DESC", "role": "assistant" } ]
[ { "content": "What is the owner of the channel that has the highest rating ratio?", "role": "user" }, { "content": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1", "role": "assistant" } ]
[ { "content": "Show me the owner of the channel with the highest rating.", "role": "user" }, { "content": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1", "role": "assistant" } ]
[ { "content": "how many programs are there?", "role": "user" }, { "content": "SELECT count(*) FROM program", "role": "assistant" } ]
[ { "content": "Count the number of programs.", "role": "user" }, { "content": "SELECT count(*) FROM program", "role": "assistant" } ]
[ { "content": "list all the names of programs, ordering by launch time.", "role": "user" }, { "content": "SELECT name FROM program ORDER BY launch", "role": "assistant" } ]
[ { "content": "What is the list of program names, sorted by the order of launch date?", "role": "user" }, { "content": "SELECT name FROM program ORDER BY launch", "role": "assistant" } ]
[ { "content": "List the name, origin and owner of each program.", "role": "user" }, { "content": "SELECT name , origin , OWNER FROM program", "role": "assistant" } ]
[ { "content": "What are the name, origin and owner of each program?", "role": "user" }, { "content": "SELECT name , origin , OWNER FROM program", "role": "assistant" } ]
[ { "content": "find the name of the program that was launched most recently.", "role": "user" }, { "content": "SELECT name FROM program ORDER BY launch DESC LIMIT 1", "role": "assistant" } ]
[ { "content": "Which program was launched most recently? Return the program name.", "role": "user" }, { "content": "SELECT name FROM program ORDER BY launch DESC LIMIT 1", "role": "assistant" } ]
[ { "content": "find the total percentage share of all channels owned by CCTV.", "role": "user" }, { "content": "SELECT sum(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'", "role": "assistant" } ]
[ { "content": "What is the total share (in percent) of all the channels owned by CCTV?", "role": "user" }, { "content": "SELECT sum(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'", "role": "assistant" } ]
[ { "content": "Find the names of the channels that are broadcast in the morning.", "role": "user" }, { "content": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'", "role": "assistant" } ]
[ { "content": "Which channels are broadcast in the morning? Give me the channel names.", "role": "user" }, { "content": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'", "role": "assistant" } ]
[ { "content": "what are the names of the channels that broadcast in both morning and night?", "role": "user" }, { "content": "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'", "role": "assistant" } ]
[ { "content": "Which channels broadcast both in the morning and at night? Give me the channel names.", "role": "user" }, { "content": "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'", "role": "assistant" } ]
[ { "content": "how many programs are broadcast in each time section of the day?", "role": "user" }, { "content": "SELECT count(*) , time_of_day FROM broadcast GROUP BY time_of_day", "role": "assistant" } ]
[ { "content": "Count the number of programs broadcast for each time section of a day.", "role": "user" }, { "content": "SELECT count(*) , time_of_day FROM broadcast GROUP BY time_of_day", "role": "assistant" } ]
[ { "content": "find the number of different programs that are broadcast during night time.", "role": "user" }, { "content": "SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'", "role": "assistant" } ]
[ { "content": "How many distinct programs are broadcast at \"Night\" time?", "role": "user" }, { "content": "SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'", "role": "assistant" } ]
[ { "content": "Find the names of programs that are never broadcasted in the morning.", "role": "user" }, { "content": "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\"", "role": "assistant" } ]
[ { "content": "Which programs are never broadcasted in the morning? Give me the names of the programs.", "role": "user" }, { "content": "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\"", "role": "assistant" } ]
[ { "content": "find the program owners that have some programs in both morning and night time.", "role": "user" }, { "content": "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\"", "role": "assistant" } ]
[ { "content": "Who are the owners of the programs that broadcast both in the morning and at night?", "role": "user" }, { "content": "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\"", "role": "assistant" } ]
[ { "content": "List all program origins in the alphabetical order.", "role": "user" }, { "content": "SELECT origin FROM program ORDER BY origin", "role": "assistant" } ]
[ { "content": "What is the list of program origins ordered alphabetically?", "role": "user" }, { "content": "SELECT origin FROM program ORDER BY origin", "role": "assistant" } ]
[ { "content": "what is the number of different channel owners?", "role": "user" }, { "content": "SELECT count(DISTINCT OWNER) FROM channel", "role": "assistant" } ]
[ { "content": "Count the number of distinct channel owners.", "role": "user" }, { "content": "SELECT count(DISTINCT OWNER) FROM channel", "role": "assistant" } ]
[ { "content": "find the names of programs whose origin is not in Beijing.", "role": "user" }, { "content": "SELECT name FROM program WHERE origin != 'Beijing'", "role": "assistant" } ]
[ { "content": "Which programs' origins are not \"Beijing\"? Give me the program names.", "role": "user" }, { "content": "SELECT name FROM program WHERE origin != 'Beijing'", "role": "assistant" } ]
[ { "content": "What are the names of the channels owned by CCTV or HBS?", "role": "user" }, { "content": "SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'", "role": "assistant" } ]
[ { "content": "List the names of all the channels owned by either CCTV or HBS", "role": "user" }, { "content": "SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'", "role": "assistant" } ]
[ { "content": "Find the total rating ratio for each channel owner.", "role": "user" }, { "content": "SELECT sum(Rating_in_percent) , OWNER FROM channel GROUP BY OWNER", "role": "assistant" } ]
[ { "content": "What is the total rating of channel for each channel owner?", "role": "user" }, { "content": "SELECT sum(Rating_in_percent) , OWNER FROM channel GROUP BY OWNER", "role": "assistant" } ]
[ { "content": "Find the name of the program that is broadcast most frequently.", "role": "user" }, { "content": "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", "role": "assistant" } ]
[ { "content": "Which program is broadcast most frequently? Give me the program name.", "role": "user" }, { "content": "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", "role": "assistant" } ]
[ { "content": "How many courses are there in total?", "role": "user" }, { "content": "SELECT count(*) FROM COURSES", "role": "assistant" } ]
[ { "content": "Find the total number of courses offered.", "role": "user" }, { "content": "SELECT count(*) FROM COURSES", "role": "assistant" } ]
[ { "content": "What are the descriptions of the courses with name \"database\"?", "role": "user" }, { "content": "SELECT course_description FROM COURSES WHERE course_name = \"database\"", "role": "assistant" } ]
[ { "content": "Return the description for the courses named \"database\".", "role": "user" }, { "content": "SELECT course_description FROM COURSES WHERE course_name = \"database\"", "role": "assistant" } ]
[ { "content": "What are the addresses of the course authors or tutors with personal name \"Cathrine\"", "role": "user" }, { "content": "SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name\t = \"Cathrine\"", "role": "assistant" } ]
[ { "content": "Return the addresses of the course authors or tutors whose personal name is \"Cathrine\".", "role": "user" }, { "content": "SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name\t = \"Cathrine\"", "role": "assistant" } ]
[ { "content": "List the addresses of all the course authors or tutors.", "role": "user" }, { "content": "SELECT address_line_1 FROM Course_Authors_and_Tutors", "role": "assistant" } ]
[ { "content": "What is the address of each course author or tutor?", "role": "user" }, { "content": "SELECT address_line_1 FROM Course_Authors_and_Tutors", "role": "assistant" } ]
[ { "content": "List all the login names and family names of course author and tutors.", "role": "user" }, { "content": "SELECT login_name , family_name FROM Course_Authors_and_Tutors", "role": "assistant" } ]
[ { "content": "What are the login names and family names of course author and tutors?", "role": "user" }, { "content": "SELECT login_name , family_name FROM Course_Authors_and_Tutors", "role": "assistant" } ]
[ { "content": "List all the dates of enrollment and completion of students.", "role": "user" }, { "content": "SELECT date_of_enrolment , date_of_completion FROM Student_Course_Enrolment", "role": "assistant" } ]
[ { "content": "What are all the dates of enrollment and completion in record?", "role": "user" }, { "content": "SELECT date_of_enrolment , date_of_completion FROM Student_Course_Enrolment", "role": "assistant" } ]
[ { "content": "How many distinct students are enrolled in courses?", "role": "user" }, { "content": "SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment", "role": "assistant" } ]
[ { "content": "Find the number of distinct students enrolled in courses.", "role": "user" }, { "content": "SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment", "role": "assistant" } ]
[ { "content": "How many distinct courses are enrolled in by students?", "role": "user" }, { "content": "SELECT count(course_id) FROM Student_Course_Enrolment", "role": "assistant" } ]
[ { "content": "Find the number of distinct courses that have enrolled students.", "role": "user" }, { "content": "SELECT count(course_id) FROM Student_Course_Enrolment", "role": "assistant" } ]
[ { "content": "Find the dates of the tests taken with result \"Pass\".", "role": "user" }, { "content": "SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = \"Pass\"", "role": "assistant" } ]
[ { "content": "Which tests have \"Pass\" results? Return the dates when the tests were taken.", "role": "user" }, { "content": "SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = \"Pass\"", "role": "assistant" } ]
[ { "content": "How many tests have result \"Fail\"?", "role": "user" }, { "content": "SELECT count(*) FROM Student_Tests_Taken WHERE test_result = \"Fail\"", "role": "assistant" } ]
[ { "content": "Count the number of tests with \"Fail\" result.", "role": "user" }, { "content": "SELECT count(*) FROM Student_Tests_Taken WHERE test_result = \"Fail\"", "role": "assistant" } ]
[ { "content": "What are the login names of the students with family name \"Ward\"?", "role": "user" }, { "content": "SELECT login_name FROM Students WHERE family_name = \"Ward\"", "role": "assistant" } ]
[ { "content": "Return the login names of the students whose family name is \"Ward\".", "role": "user" }, { "content": "SELECT login_name FROM Students WHERE family_name = \"Ward\"", "role": "assistant" } ]
[ { "content": "What are the dates of the latest logon of the students with family name \"Jaskolski\" or \"Langosh\"?", "role": "user" }, { "content": "SELECT date_of_latest_logon FROM Students WHERE family_name = \"Jaskolski\" OR family_name = \"Langosh\"", "role": "assistant" } ]
[ { "content": "Find the latest logon date of the students whose family name is \"Jaskolski\" or \"Langosh\".", "role": "user" }, { "content": "SELECT date_of_latest_logon FROM Students WHERE family_name = \"Jaskolski\" OR family_name = \"Langosh\"", "role": "assistant" } ]
[ { "content": "How many students have personal names that contain the word \"son\"?", "role": "user" }, { "content": "SELECT COUNT(*) FROM Students WHERE personal_name LIKE \"%son%\"", "role": "assistant" } ]
[ { "content": "Find the number of students who have the word \"son\" in their personal names.", "role": "user" }, { "content": "SELECT COUNT(*) FROM Students WHERE personal_name LIKE \"%son%\"", "role": "assistant" } ]
[ { "content": "List all the subject names.", "role": "user" }, { "content": "SELECT subject_name FROM SUBJECTS", "role": "assistant" } ]
[ { "content": "What are the names of all the subjects.", "role": "user" }, { "content": "SELECT subject_name FROM SUBJECTS", "role": "assistant" } ]
[ { "content": "List all the information about course authors and tutors in alphabetical order of the personal name.", "role": "user" }, { "content": "SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name", "role": "assistant" } ]
[ { "content": "Sort the information about course authors and tutors in alphabetical order of the personal name.", "role": "user" }, { "content": "SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name", "role": "assistant" } ]
[ { "content": "List the personal names and family names of all the students in alphabetical order of family name.", "role": "user" }, { "content": "SELECT personal_name , family_name FROM Students ORDER BY family_name", "role": "assistant" } ]
[ { "content": "What are the personal names and family names of the students? Sort the result in alphabetical order of the family name.", "role": "user" }, { "content": "SELECT personal_name , family_name FROM Students ORDER BY family_name", "role": "assistant" } ]