minktn/spider-data huggingface dataset:
Database: music_1
Question: List the id, genre and artist name of English songs ordered by rating.
SQL: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "english" ORDER BY rating
Database: music_1
Question: What is the id, genre, and name of the artist for every English song ordered by ascending rating?
SQL: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "english" ORDER BY rating
Database: music_1
Question: List the duration, file size and format of songs whose genre is pop, ordered by title?
SQL: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_name
Database: music_1
Question: What is the duration, file size, and song format for every pop song, ordered by title alphabetically?
SQL: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_name
Database: music_1
Question: Find the names of the artists who have produced English songs but have never received rating higher than 8.
SQL: SELECT DISTINCT artist_name FROM song WHERE languages  =  "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  8
Database: music_1
Question: What are the names of the different artists that have produced a song in English but have never receieved a rating higher than 8?
SQL: SELECT DISTINCT artist_name FROM song WHERE languages  =  "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  8
Database: music_1
Question: Find the names of the artists who are from Bangladesh and have never received rating higher than 7.
SQL: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7
Database: music_1
Question: What are the names of the different artists from Bangladesh who never received a rating higher than a 7?
SQL: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7
Database: baseball_1
Question: What is average salary of the players in the team named 'Boston Red Stockings' ?
SQL: SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings'
Database: baseball_1
Question: Compute the average salary of the players in the team called 'Boston Red Stockings'.
SQL: SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings'
Database: baseball_1
Question: What are first and last names of players participating in all star game in 1998?
SQL: SELECT name_first ,  name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id  =  T2.player_id WHERE YEAR  =  1998
Database: baseball_1
Question: List the first and last name for players who participated in all star game in 1998.
SQL: SELECT name_first ,  name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id  =  T2.player_id WHERE YEAR  =  1998
Database: baseball_1
Question: Find the players' first name and last name who won award both in 1960 and in 1961.
SQL: SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year  =  1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year  =  1961
Database: baseball_1
Question: Which players won awards in both 1960 and 1961? Return their first names and last names.
SQL: SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year  =  1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year  =  1961
Database: baseball_1
Question: List players' first name and last name who have weight greater than 220 or height shorter than 75.
SQL: SELECT name_first ,  name_last FROM player WHERE weight  >  220 OR height  <  75
Database: baseball_1
Question: What are the first name and last name of the players who have weight above 220 or height below 75?
SQL: SELECT name_first ,  name_last FROM player WHERE weight  >  220 OR height  <  75
Database: baseball_1
Question: What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
SQL: SELECT count(*) ,  T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' GROUP BY T1.year
Database: baseball_1
Question: For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons.
SQL: SELECT count(*) ,  T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' GROUP BY T1.year
Database: baseball_1
Question: What is the total salary paid by team Boston Red Stockings in 2010?
SQL: SELECT sum(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2010
Database: baseball_1
Question: What is the total salary expenses of team Boston Red Stockings in 2010?
SQL: SELECT sum(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2010
Database: baseball_1
Question: How many players were in the team Boston Red Stockings in 2000?
SQL: SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2000
Database: baseball_1
Question: How many players did Boston Red Stockings have in 2000?
SQL: SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2000
Database: baseball_1
Question: What were all the salary values of players in 2010 and 2001?
SQL: SELECT salary FROM salary WHERE YEAR  =  2010 UNION SELECT salary FROM salary WHERE YEAR  =  2001
Database: baseball_1
Question: List all the salary values players received in 2010 and 2001.
SQL: SELECT salary FROM salary WHERE YEAR  =  2010 UNION SELECT salary FROM salary WHERE YEAR  =  2001
Database: baseball_1
Question: List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
SQL: SELECT T2.name_first ,  T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
Database: baseball_1
Question: What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007?
SQL: SELECT T2.name_first ,  T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
Database: mountain_photos
Question: How many camera lenses have a focal length longer than 15 mm?
SQL: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
Database: mountain_photos
Question: Find the brand and name for each camera lens, and sort in descending order of maximum aperture.
SQL: SELECT brand ,  name FROM camera_lens ORDER BY max_aperture DESC
Database: mountain_photos
Question: List the id, color scheme, and name for all the photos.
SQL: SELECT id ,  color ,  name FROM photos
Database: mountain_photos
Question: What are the maximum and average height of the mountains?
SQL: SELECT max(height) ,  avg(height) FROM mountain
Database: mountain_photos
Question: What are the average prominence of the mountains in country 'Morocco'?
SQL: SELECT avg(prominence) FROM mountain WHERE country  =  'Morocco'
Database: mountain_photos
Question: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?
SQL: SELECT name ,  height ,  prominence FROM mountain WHERE range != 'Aberdare Range'
Database: mountain_photos
Question: What are the id and name of the photos for mountains?
SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
Database: mountain_photos
Question: What are the id and name of the mountains that have at least 2 photos?
SQL: 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
Database: mountain_photos
Question: What are the names of the cameras that have taken picture of the most mountains?
SQL: 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
Database: mountain_photos
Question: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
SQL: 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'
Database: mountain_photos
Question: How many different kinds of lens brands are there?
SQL: SELECT count(DISTINCT brand) FROM camera_lens
Database: mountain_photos
Question: How many camera lenses are not used in taking any photos?
SQL: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
Database: mountain_photos
Question: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?
SQL: 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'
Database: mountain_photos
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'
SQL: 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'
Database: mountain_photos
Question: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
SQL: 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'
Database: mountain_photos
Question: List the camera lens names containing substring "Digital".
SQL: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
Database: mountain_photos
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.
SQL: 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(*)
Database: program_share
Question: Find the names of channels that are not owned by CCTV.
SQL: SELECT name FROM channel WHERE OWNER != 'CCTV'
Database: program_share
Question: Which channels are not owned by CCTV? Give me the channel names.
SQL: SELECT name FROM channel WHERE OWNER != 'CCTV'
Database: program_share
Question: List all channel names ordered by their rating in percent from big to small.
SQL: SELECT name FROM channel ORDER BY rating_in_percent DESC
Database: program_share
Question: Give me a list of all the channel names sorted by the channel rating in descending order.
SQL: SELECT name FROM channel ORDER BY rating_in_percent DESC
Database: program_share
Question: What is the owner of the channel that has the highest rating ratio?
SQL: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
Database: program_share
Question: Show me the owner of the channel with the highest rating.
SQL: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
Database: program_share
Question: how many programs are there?
SQL: SELECT count(*) FROM program
Database: program_share
Question: Count the number of programs.
SQL: SELECT count(*) FROM program
Database: program_share
Question: list all the names of programs, ordering by launch time.
SQL: SELECT name FROM program ORDER BY launch
Database: program_share
Question: What is the list of program names, sorted by the order of launch date?
SQL: SELECT name FROM program ORDER BY launch
Database: program_share
Question: List the name, origin and owner of each program.
SQL: SELECT name ,  origin ,  OWNER FROM program
Database: program_share
Question: What are the name, origin and owner of each program?
SQL: SELECT name ,  origin ,  OWNER FROM program
Database: program_share
Question: find the name of the program that was launched most recently.
SQL: SELECT name FROM program ORDER BY launch DESC LIMIT 1
Database: program_share
Question: Which program was launched most recently? Return the program name.
SQL: SELECT name FROM program ORDER BY launch DESC LIMIT 1
Database: program_share
Question: find the total percentage share of all channels owned by CCTV.
SQL: SELECT sum(Share_in_percent) FROM channel WHERE OWNER  =  'CCTV'
Database: program_share
Question: What is the total share (in percent) of all the channels owned by CCTV?
SQL: SELECT sum(Share_in_percent) FROM channel WHERE OWNER  =  'CCTV'
Database: program_share
Question: Find the names of the channels that are broadcast in the morning.
SQL: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning'
Database: program_share
Question: Which channels are broadcast in the morning? Give me the channel names.
SQL: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning'
Database: program_share
Question: what are the names of the channels that broadcast in both morning and night?
SQL: 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'
Database: program_share
Question: Which channels broadcast both in the morning and at night? Give me the channel names.
SQL: 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'
Database: program_share
Question: how many programs are broadcast in each time section of the day?
SQL: SELECT count(*) ,  time_of_day FROM broadcast GROUP BY time_of_day
Database: program_share
Question: Count the number of programs broadcast for each time section of a day.
SQL: SELECT count(*) ,  time_of_day FROM broadcast GROUP BY time_of_day
Database: program_share
Question: find the number of different programs that are broadcast during night time.
SQL: SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day  =  'Night'
Database: program_share
Question: How many distinct programs are broadcast at "Night" time?
SQL: SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day  =  'Night'
Database: program_share
Question: Find the names of programs that are never broadcasted in the morning.
SQL: 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"
Database: program_share
Question: Which programs are never broadcasted in the morning? Give me the names of the programs.
SQL: 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"
Database: program_share
Question: find the program owners that have some programs in both morning and night time.
SQL: 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"
Database: program_share
Question: Who are the owners of the programs that broadcast both in the morning and at night?
SQL: 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"
Database: program_share
Question: List all program origins in the alphabetical order.
SQL: SELECT origin FROM program ORDER BY origin
Database: program_share
Question: What is the list of program origins ordered alphabetically?
SQL: SELECT origin FROM program ORDER BY origin
Database: program_share
Question: what is the number of different channel owners?
SQL: SELECT count(DISTINCT OWNER) FROM channel
Database: program_share
Question: Count the number of distinct channel owners.
SQL: SELECT count(DISTINCT OWNER) FROM channel
Database: program_share
Question: find the names of programs whose origin is not in Beijing.
SQL: SELECT name FROM program WHERE origin != 'Beijing'
Database: program_share
Question: Which programs' origins are not "Beijing"? Give me the program names.
SQL: SELECT name FROM program WHERE origin != 'Beijing'
Database: program_share
Question: What are the names of the channels owned by CCTV or HBS?
SQL: SELECT name FROM channel WHERE OWNER  =  'CCTV' OR OWNER  =  'HBS'
Database: program_share
Question: List the names of all the channels owned by either CCTV or HBS
SQL: SELECT name FROM channel WHERE OWNER  =  'CCTV' OR OWNER  =  'HBS'
Database: program_share
Question: Find the total rating ratio for each channel owner.
SQL: SELECT sum(Rating_in_percent) ,  OWNER FROM channel GROUP BY OWNER
Database: program_share
Question: What is the total rating of channel for each channel owner?
SQL: SELECT sum(Rating_in_percent) ,  OWNER FROM channel GROUP BY OWNER
Database: program_share
Question: Find the name of the program that is broadcast most frequently.
SQL: 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
Database: program_share
Question: Which program is broadcast most frequently? Give me the program name.
SQL: 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
Database: e_learning
Question: How many courses are there in total?
SQL: SELECT count(*) FROM COURSES
Database: e_learning
Question: Find the total number of courses offered.
SQL: SELECT count(*) FROM COURSES
Database: e_learning
Question: What are the descriptions of the courses with name "database"?
SQL: SELECT course_description FROM COURSES WHERE course_name  =  "database"
Database: e_learning
Question: Return the description for the courses named "database".
SQL: SELECT course_description FROM COURSES WHERE course_name  =  "database"
Database: e_learning
Question: What are the addresses of the course authors or tutors with personal name "Cathrine"
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine"
Database: e_learning
Question: Return the addresses of the course authors or tutors whose personal name is "Cathrine".
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine"
Database: e_learning
Question: List the addresses of all the course authors or tutors.
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors
Database: e_learning
Question: What is the address of each course author or tutor?
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors
Database: e_learning
Question: List all the login names and family names of course author and tutors.
SQL: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors
Database: e_learning
Question: What are the login names and family names of course author and tutors?
SQL: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors
Database: e_learning
Question: List all the dates of enrollment and completion of students.
SQL: SELECT date_of_enrolment ,  date_of_completion FROM Student_Course_Enrolment
Database: e_learning
Question: What are all the dates of enrollment and completion in record?
SQL: SELECT date_of_enrolment ,  date_of_completion FROM Student_Course_Enrolment
Database: e_learning
Question: How many distinct students are enrolled in courses?
SQL: SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment
Database: e_learning
Question: Find the number of distinct students enrolled in courses.
SQL: SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment
Database: e_learning
Question: How many distinct courses are enrolled in by students?
SQL: SELECT count(course_id) FROM Student_Course_Enrolment
Database: e_learning
Question: Find the number of distinct courses that have enrolled students.
SQL: SELECT count(course_id) FROM Student_Course_Enrolment
Database: e_learning
Question: Find the dates of the tests taken with result "Pass".
SQL: SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result  =  "Pass"
Database: e_learning
Question: Which tests have "Pass" results? Return the dates when the tests were taken.
SQL: SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result  =  "Pass"
Database: e_learning
Question: How many tests have result "Fail"?
SQL: SELECT count(*) FROM Student_Tests_Taken WHERE test_result  =  "Fail"
Database: e_learning
Question: Count the number of tests with "Fail" result.
SQL: SELECT count(*) FROM Student_Tests_Taken WHERE test_result  =  "Fail"
Database: e_learning
Question: What are the login names of the students with family name "Ward"?
SQL: SELECT login_name FROM Students WHERE family_name  =  "Ward"
Database: e_learning
Question: Return the login names of the students whose family name is "Ward".
SQL: SELECT login_name FROM Students WHERE family_name  =  "Ward"
Database: e_learning
Question: What are the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"?
SQL: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh"
Database: e_learning
Question: Find the latest logon date of the students whose family name is "Jaskolski" or "Langosh".
SQL: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh"
Database: e_learning
Question: How many students have personal names that contain the word "son"?
SQL: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
Database: e_learning
Question: Find the number of students who have the word "son" in their personal names.
SQL: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
Database: e_learning
Question: List all the subject names.
SQL: SELECT subject_name FROM SUBJECTS
Database: e_learning
Question: What are the names of all the subjects.
SQL: SELECT subject_name FROM SUBJECTS
Database: e_learning
Question: List all the information about course authors and tutors in alphabetical order of the personal name.
SQL: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name
Database: e_learning
Question: Sort the information about course authors and tutors in alphabetical order of the personal name.
SQL: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name
Database: e_learning
Question: List the personal names and family names of all the students in alphabetical order of family name.
SQL: SELECT personal_name ,  family_name FROM Students ORDER BY family_name
Database: e_learning
Question: What are the personal names and family names of the students? Sort the result in alphabetical order of the family name.
SQL: SELECT personal_name ,  family_name FROM Students ORDER BY family_name
Database: e_learning
Question: List each test result and its count in descending order of count.
SQL: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
Database: e_learning
Question: For each distinct test result, find the number of students who got the result.
SQL: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
Database: e_learning
Question: Find the login name of the course author that teaches the course with name "advanced database".
SQL: SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"
Database: e_learning
Question: Which course author teaches the "advanced database" course? Give me his or her login name.
SQL: SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"
Database: e_learning
Question: Find the addresses of the course authors who teach the course with name "operating system" or "data structure".
SQL: SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "operating system" OR T2.course_name  =  "data structure"
Database: e_learning
Question: What are the addresses of the course authors who teach either "operating system" or "data structure" course.
SQL: SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "operating system" OR T2.course_name  =  "data structure"
Database: e_learning
Question: Find the personal name, family name, and author ID of the course author that teaches the most courses.
SQL: SELECT T1.personal_name ,  T1.family_name ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1
Database: e_learning
Question: What are the personal name, family name, and author ID of the course author who teaches the most courses?
SQL: SELECT T1.personal_name ,  T1.family_name ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1
Database: e_learning
Question: Find the addresses and author IDs of the course authors that teach at least two courses.
SQL: SELECT T1.address_line_1 ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id HAVING Count(*)  >=  2
Database: e_learning
Question: Which course authors teach two or more courses? Give me their addresses and author IDs.
SQL: SELECT T1.address_line_1 ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id HAVING Count(*)  >=  2
Database: e_learning
Question: Find the names of courses taught by the tutor who has personal name "Julio".
SQL: SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T1.personal_name  =  "Julio"
Database: e_learning
Question: What are the names of the courses taught by the tutor whose personal name is "Julio"?
SQL: SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T1.personal_name  =  "Julio"
Database: e_learning
Question: Find the names and descriptions of courses that belong to the subject named "Computer Science".
SQL: SELECT T1.course_name ,  T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id WHERE T2.subject_name  =  "Computer Science"
Database: e_learning
Question: What are the names and descriptions of the all courses under the "Computer Science" subject?
SQL: SELECT T1.course_name ,  T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id WHERE T2.subject_name  =  "Computer Science"
Database: e_learning
Question: Find the subject ID, subject name, and the corresponding number of available courses for each subject.
SQL: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id
Database: e_learning
Question: What are the subject ID, subject name, and the number of available courses for each subject?
SQL: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id
Database: e_learning
Question: Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order.
SQL: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC
Database: e_learning
Question: List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts.
SQL: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC
Database: e_learning
Question: What is the date of enrollment of the course named "Spanish"?
SQL: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id WHERE T1.course_name  =  "Spanish"
Database: e_learning
Question: Find the the date of enrollment of the "Spanish" course.
SQL: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id WHERE T1.course_name  =  "Spanish"
Database: e_learning
Question: What is the name of the course that has the most student enrollment?
SQL: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1
Database: e_learning
Question: Which course is enrolled in by the most students? Give me the course name.
SQL: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1
Database: e_learning
Question: What are the names of the courses that have exactly 1 student enrollment?
SQL: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  =  1
Database: e_learning
Question: Find the names of the courses that have just one student enrollment.
SQL: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  =  1
Database: e_learning
Question: What are the descriptions and names of the courses that have student enrollment bigger than 2?
SQL: SELECT T1.course_description ,  T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  >  2
Database: e_learning
Question: Return the descriptions and names of the courses that have more than two students enrolled in.
SQL: SELECT T1.course_description ,  T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  >  2
Database: e_learning
Question: What is the name of each course and the corresponding number of student enrollment?
SQL: SELECT T1.course_name ,  COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name
Database: e_learning
Question: List the name and the number of enrolled student for each course.
SQL: SELECT T1.course_name ,  COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name
Database: e_learning
Question: What are the enrollment dates of all the tests that have result "Pass"?
SQL: SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Pass"
Database: e_learning
Question: Find the enrollment date for all the tests that have "Pass" result.
SQL: SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Pass"
Database: e_learning
Question: What are the completion dates of all the tests that have result "Fail"?
SQL: SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Fail"
Database: e_learning
Question: Return the completion date for all the tests that have "Fail" result.
SQL: SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Fail"
Database: e_learning
Question: List the dates of enrollment and completion of the student with personal name "Karson".
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.personal_name  =  "Karson"
Database: e_learning
Question: On what dates did the student whose personal name is "Karson" enroll in and complete the courses?
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.personal_name  =  "Karson"
Database: e_learning
Question: List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie".
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.family_name  =  "Zieme" AND T2.personal_name  =  "Bernie"
Database: e_learning
Question: On what dates did the student with family name "Zieme" and personal name "Bernie" enroll in and complete the courses?
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.family_name  =  "Zieme" AND T2.personal_name  =  "Bernie"
Database: e_learning
Question: Find the student ID and login name of the student with the most course enrollments
SQL: SELECT T1.student_id ,  T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
Database: e_learning
Question: What are the student ID and login name of the student who are enrolled in the most courses?
SQL: SELECT T1.student_id ,  T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
Database: e_learning
Question: Find the student ID and personal name of the student with at least two enrollments.
SQL: SELECT T1.student_id ,  T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  >=  2
Database: e_learning
Question: Which student are enrolled in at least two courses? Give me the student ID and personal name.
SQL: SELECT T1.student_id ,  T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  >=  2
Database: e_learning
Question: Find the student ID and middle name for all the students with at most two enrollments.
SQL: SELECT T1.student_id ,  T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  <=  2
Database: e_learning
Question: What are the student IDs and middle names of the students enrolled in at most two courses?
SQL: SELECT T1.student_id ,  T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  <=  2
Database: e_learning
Question: Find the personal names of students not enrolled in any course.
SQL: SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id  =  T2.student_id
Database: e_learning
Question: Which students not enrolled in any course? Find their personal names.
SQL: SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id  =  T2.student_id
Database: e_learning
Question: How many students did not have any course enrollment?
SQL: SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)
Database: e_learning
Question: Count the number of students who did not enroll in any course.
SQL: SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)
Database: e_learning
Question: Find the common login name of course authors and students.
SQL: SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students
Database: e_learning
Question: What are the login names used both by some course authors and some students?
SQL: SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students
Database: e_learning
Question: Find the common personal name of course authors and students.
SQL: SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students
Database: e_learning
Question: What are the personal names used both by some course authors and some students?
SQL: SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students
Database: insurance_policies
Question: Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id.
SQL: SELECT T1.Date_Claim_Made ,  T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id  =  T2.Claim_id GROUP BY T1.Claim_id HAVING count(*)  >  2 UNION SELECT T1.Date_Claim_Made ,  T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id  =  T2.Claim_id WHERE T1.Amount_Claimed  =  ( SELECT max(Amount_Claimed) FROM Claims )
Database: insurance_policies
Question: Find the claims that led to more than two settlements or have the maximum claim value. For each of them, return the date the claim was made and the id of the claim.
SQL: SELECT T1.Date_Claim_Made ,  T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id  =  T2.Claim_id GROUP BY T1.Claim_id HAVING count(*)  >  2 UNION SELECT T1.Date_Claim_Made ,  T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id  =  T2.Claim_id WHERE T1.Amount_Claimed  =  ( SELECT max(Amount_Claimed) FROM Claims )
Database: insurance_policies
Question: Which customer had at least 2 policies but did not file any claims? List the customer details and id.
SQL: SELECT T1.customer_details ,  T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2 EXCEPT SELECT T1.customer_details ,  T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id  =  T2.customer_id JOIN Claims AS T3 ON T2.policy_id  =  T3.policy_id
Database: insurance_policies
Question: Give me the the customer details and id for the customers who had two or more policies but did not file any claims.
SQL: SELECT T1.customer_details ,  T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2 EXCEPT SELECT T1.customer_details ,  T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id  =  T2.customer_id JOIN Claims AS T3 ON T2.policy_id  =  T3.policy_id
Database: insurance_policies
Question: List the method, date and amount of all the payments, in ascending order of date.
SQL: SELECT Payment_Method_Code ,  Date_Payment_Made ,  Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC
Database: insurance_policies
Question: What are the method, date and amount of each payment? Sort the list in ascending order of date.
SQL: SELECT Payment_Method_Code ,  Date_Payment_Made ,  Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC
Database: insurance_policies
Question: Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.
SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
Database: insurance_policies
Question: Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount.
SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
Database: insurance_policies
Question: Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.
SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1
Database: insurance_policies
Question: Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount.
SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1
Database: insurance_policies
Question: Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.
SQL: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Claims WHERE Amount_Claimed  >  ( SELECT avg(Amount_Claimed) FROM Claims )
Database: insurance_policies
Question: Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average.
SQL: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Claims WHERE Amount_Claimed  >  ( SELECT avg(Amount_Claimed) FROM Claims )
Database: insurance_policies
Question: Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.
SQL: SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled  <=  ( SELECT avg(Amount_Settled) FROM Claims )
Database: insurance_policies
Question: Return the claim start date for the claims whose claimed amount is no more than the average
SQL: SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled  <=  ( SELECT avg(Amount_Settled) FROM Claims )
Database: insurance_policies
Question: How many settlements does each claim correspond to? List the claim id and the number of settlements.
SQL: SELECT T1.Claim_id ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id
Database: insurance_policies
Question: Find the number of settlements each claim corresponds to. Show the number together with the claim id.
SQL: SELECT T1.Claim_id ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id
Database: insurance_policies
Question: Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.
SQL: SELECT T1.claim_id ,  T1.date_claim_made ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1
Database: insurance_policies
Question: Find the claim id and claim date of the claim that incurred the most settlement count. Also tell me the count.
SQL: SELECT T1.claim_id ,  T1.date_claim_made ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1
Database: insurance_policies
Question: How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.
SQL: SELECT count(*) ,  T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1
Database: insurance_policies
Question: Find the claim id and the number of settlements made for the claim with the most recent settlement date.
SQL: SELECT count(*) ,  T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1
Database: insurance_policies
Question: Of all the claims, what was the earliest date when any claim was made?
SQL: SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1
Database: insurance_policies
Question: Tell me the the date when the first claim was made.
SQL: SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1
Database: insurance_policies
Question: What is the total amount of settlement made for all the settlements?
SQL: SELECT sum(Amount_Settled) FROM Settlements
Database: insurance_policies
Question: Compute the total amount of settlement across all the settlements.
SQL: SELECT sum(Amount_Settled) FROM Settlements
Database: insurance_policies
Question: Who are the customers that had more than 1 policy? List the customer details and id.
SQL: SELECT T1.customer_details ,  T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id  =  T2.Customer_id GROUP BY T1.customer_id HAVING count(*)  >  1
Database: insurance_policies
Question: Find the the customer details and id for the customers who had more than one policy.
SQL: SELECT T1.customer_details ,  T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id  =  T2.Customer_id GROUP BY T1.customer_id HAVING count(*)  >  1
Database: insurance_policies
Question: What are the claim dates and settlement dates of all the settlements?
SQL: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Settlements
Database: insurance_policies
Question: Tell me the the claim date and settlement date for each settlement case.
SQL: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Settlements
Database: insurance_policies
Question: What is the most popular payment method?
SQL: SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1
Database: insurance_policies
Question: Which payment method is used the most often?
SQL: SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1
Database: insurance_policies
Question: With which kind of payment method were the least number of payments processed?
SQL: SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1
Database: insurance_policies
Question: What is the payment method that were used the least often?
SQL: SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1
Database: insurance_policies
Question: What is the total amount of payment?
SQL: SELECT sum(Amount_Payment) FROM Payments
Database: insurance_policies
Question: Compute the total amount of payment processed.
SQL: SELECT sum(Amount_Payment) FROM Payments
Database: insurance_policies
Question: What are all the distinct details of the customers?
SQL: SELECT DISTINCT customer_details FROM Customers
Database: insurance_policies
Question: Return the distinct customer details.
SQL: SELECT DISTINCT customer_details FROM Customers
Database: insurance_policies
Question: Which kind of policy type was chosen by the most customers?
SQL: SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1
Database: insurance_policies
Question: Find the policy type the most customers choose.
SQL: SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1
Database: insurance_policies
Question: How many settlements are there in total?
SQL: SELECT count(*) FROM Settlements
Database: insurance_policies
Question: Count the total number of settlements made.
SQL: SELECT count(*) FROM Settlements
Database: insurance_policies
Question: Which Payments were processed with Visa? List the payment Id, the date and the amount.
SQL: SELECT Payment_ID ,  Date_Payment_Made ,  Amount_Payment FROM Payments WHERE Payment_Method_Code  =  'Visa'