niryuu/sni-each-converted huggingface dataset:
What is the average and the maximum capacity of all stadiums?
Output: SELECT avg(capacity) ,  max(capacity) FROM stadium
What is the name and capacity of the stadium  with the most concerts after 2013?
Output: SELECT T2.name ,  T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  >=  2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC LIMIT 1
What are the names of the singers and number of concerts for each person?
Output: SELECT T2.name ,  count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id  =  T2.singer_id GROUP BY T2.singer_id
How many pets are owned by students that have an age greater than 20?
Output: SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid WHERE T1.age  >  20
How many dog pets are raised by female students?
Output: SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T2.petid  =  T3.petid WHERE T1.sex  =  'F' AND T3.pettype  =  'dog'
Find the name of students who have both cat and dog pets.
Output: SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pettype  =  'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pettype  =  'dog'
What type of pet is the youngest animal, and how much does it weigh?
Output: SELECT pettype ,  weight FROM pets ORDER BY pet_age LIMIT 1
What are the different first names and ages of the students who do have pets?
Output: SELECT DISTINCT T1.fname ,  T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid
For students who have pets, how many pets does each student have?
Output: SELECT count(*) ,  T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid
Find the last name of the student who has a cat that is age 3.
Output: SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pet_age  =  3 AND T3.pettype  =  'cat'
Find the make and production time of the cars that were produced in the earliest year?
Output: SELECT T2.Make ,  T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Year  =  (SELECT min(YEAR) FROM CARS_DATA)
What is the name of each continent and how many car makers are there in each one?
Output: SELECT T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.continent JOIN car_makers AS T3 ON T2.CountryId  =  T3.Country GROUP BY T1.Continent
What is the accelerate of the car make amc hornet sportabout (sw)?
Output: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Make  =  'amc hornet sportabout (sw)'
How many car models are produced in the usa?
Output: SELECT count(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id JOIN COUNTRIES AS T3 ON T2.Country  =  T3.CountryId WHERE T3.CountryName  =  'usa'
What are the countries having at least one car maker? List name and id.
Output: SELECT T1.CountryName ,  T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >=  1
What are the names of all European countries with at least 3 manufacturers?
Output: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent  =  T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId  =  T3.Country WHERE T2.Continent  =  'europe' GROUP BY T1.CountryName HAVING count(*)  >=  3
Which model saves the most gasoline? That is to say, have the maximum miles per gallon.
Output: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id ORDER BY T2.mpg DESC LIMIT 1
What is the maximum accelerate for all the different cylinders?
Output: SELECT max(Accelerate) ,  Cylinders FROM CARS_DATA GROUP BY Cylinders
Which model has the most version(make) of cars?
Output: SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY count(*) DESC LIMIT 1
Which makers designed more than 3 car models? List full name and the id.
Output: SELECT T1.FullName ,  T1.Id FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id HAVING count(*)  >  3
In which years cars were produced weighing no less than 3000 and no more than 4000?
Output: SELECT DISTINCT T1.Year FROM CARS_DATA AS T1 WHERE T1.Weight  >  3000 AND T1.weight  <  4000
What is the maximum miles per gallon of the car with 8 cylinders or produced before 1980?
Output: SELECT mpg FROM CARS_DATA WHERE Cylinders  =  8 OR YEAR  <  1980 ORDER BY mpg DESC LIMIT 1
Which models are lighter than 3500 but not built by the 'Ford Motor Company'?
Output: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model  =  T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker  =  T4.Id WHERE T3.weight  <  3500 AND T4.FullName != 'Ford Motor Company'
What are the ids and makers of all car makers that produce at least 2 models and make more than 3 cars?
Output: SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id HAVING count(*)  >=  2 INTERSECT SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model GROUP BY T1.Id HAVING count(*)  >  3
What are the ids and names of all countries that either have more than 3 car makers or produce fiats?
Output: SELECT T1.countryId ,  T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.countryId HAVING count(*)  >  3 UNION SELECT T1.countryId ,  T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country JOIN MODEL_LIST AS T3 ON T2.Id  =  T3.Maker WHERE T3.Model  =  'fiat'
What is the airport name for airport 'AKO'?
Output: SELECT AirportName FROM AIRPORTS WHERE AirportCode  =  "AKO"
How many flights depart from City 'Aberdeen' and have destination City 'Ashley'?
Output: SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport  =  T2.AirportCode JOIN AIRPORTS AS T3 ON T1.SourceAirport  =  T3.AirportCode WHERE T2.City  =  "Ashley" AND T3.City  =  "Aberdeen"
How many flights does airline 'JetBlue Airways' have?
Output: SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline  =  T2.uid WHERE T2.Airline = "JetBlue Airways"
How many 'United Airlines' flights go to Airport 'ASY'?
Output: SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline  =  T1.uid WHERE T1.Airline  =  "United Airlines" AND T2.DestAirport  =  "ASY"
How many United Airlines flights go to City 'Aberdeen'?
Output: SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport  =  T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid  =  T1.Airline WHERE T2.City  =  "Aberdeen" AND T3.Airline  =  "United Airlines"
Which city is the most frequent source airport?
Output: SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode  =  T2.SourceAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
What is the airport code of the airport with the most flights?
Output: SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode  =  T2.DestAirport OR T1.AirportCode  =  T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) DESC LIMIT 1
What is the abbreviation of the airilne has the fewest flights and what country is it in?
Output: SELECT T1.Abbreviation ,  T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline GROUP BY T1.Airline ORDER BY count(*) LIMIT 1
What are airlines that have some flight departing from airport 'AHD'?
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline WHERE T2.SourceAirport  =  "AHD"
Which airlines have a flight with destination airport AHD?
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline WHERE T2.DestAirport  =  "AHD"
Find all airlines that have flights from airport 'CVO' but not from 'APG'.
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline WHERE T2.SourceAirport  =  "CVO" EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline WHERE T2.SourceAirport  =  "APG"
Find all airlines that have at least 10 flights.
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline GROUP BY T1.Airline HAVING count(*)  >  10
Find all airlines that have fewer than 200 flights.
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline GROUP BY T1.Airline HAVING count(*)  <  200
What are flight numbers of flights arriving at Airport "APG"?
Output: SELECT FlightNo FROM FLIGHTS WHERE DestAirport  =  "APG"
How many flights land in Aberdeen or Abilene?
Output: SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport  =  T2.AirportCode WHERE T2.city  =  "Aberdeen" OR T2.city  =  "Abilene"
Find the number of employees hired in each shop; show the shop name as well.
Output: SELECT count(*) ,  t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id  =  t2.shop_id GROUP BY t2.name
What the smallest version number and its template type code?
Output: SELECT min(Version_Number) ,  template_type_code FROM Templates
Show all template type codes that are not used by any document.
Output: SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id  =  T2.template_id
Return the different descriptions for templates that have been used in a document.
Output: SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID  =  T3.template_ID
Return the different document ids along with the number of paragraphs corresponding to each, ordered by id.
Output: SELECT document_id ,  count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id
Return the id and name of the document with the most paragraphs.
Output: SELECT T1.document_id ,  T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1
Return the id of the document with the fewest paragraphs.
Output: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
What is the most commmon hometowns for teachers?
Output: SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1
What are the names of the teachers who teach at least two courses?
Output: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
Find the names of the visitors whose membership level is higher than 4, and order the results by the level from high to low.
Output: SELECT name FROM visitor WHERE Level_of_membership  >  4 ORDER BY Level_of_membership DESC
What is the average age of the visitors whose membership level is not higher than 4?
Output: SELECT avg(age) FROM visitor WHERE Level_of_membership  <=  4
Find the name and membership level of the visitors whose membership level is higher than 4, and sort by their age from old to young.
Output: SELECT name ,  Level_of_membership FROM visitor WHERE Level_of_membership  >  4 ORDER BY age DESC
What are the names of players who won in both 2013 and 2016?
Output: SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016
Find the first name and country code of the oldest player.
Output: SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1
List the first and last name of all players who are left / L hand in the order of birth date.
Output: SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date
Find the first name and country code of the player who did the most number of tours.
Output: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours DESC LIMIT 1
Find the name and rank points of the winner who won the most times.
Output: SELECT winner_name ,  winner_rank_points FROM matches GROUP BY winner_name ORDER BY count(*) DESC LIMIT 1
Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.
Output: SELECT winner_name FROM matches WHERE tourney_name  =  'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1
find the names of loser and winner who played in the match with greatest number of minutes.
Output: SELECT winner_name ,  loser_name FROM matches ORDER BY minutes DESC LIMIT 1
Find the total number of tours for each ranking date.
Output: SELECT sum(tours) ,  ranking_date FROM rankings GROUP BY ranking_date
How many different winners both participated in the WTA Championships and were left handed?
Output: SELECT count(DISTINCT winner_name) FROM matches WHERE tourney_name  =  'WTA Championships' AND winner_hand  =  'L'
Find the first name, country code and birth date of the winner who has the highest rank points in all matches.
Output: SELECT T1.first_name ,  T1.country_code ,  T1.birth_date FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id ORDER BY T2.winner_rank_points DESC LIMIT 1
How many ships ended up being 'Captured'?
Output: SELECT count(*) FROM ship WHERE disposition_of_ship  =  'Captured'
What is the average number of injuries caused each time?
Output: SELECT avg(injured) FROM death
What are the death and injury situations caused by the ship with tonnage 't'?
Output: SELECT T1.killed ,  T1.injured FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id  =  T2.id WHERE T2.tonnage  =  't'
What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I'?
Output: SELECT name FROM battle WHERE bulgarian_commander  =  'Kaloyan' AND latin_commander  =  'Baldwin I'
List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta'
Output: SELECT T1.name ,  T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id  =  T2.lost_in_battle WHERE T2.name  =  'Lettice' INTERSECT SELECT T1.name ,  T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id  =  T2.lost_in_battle WHERE T2.name  =  'HMS Atalanta'
What are the notes of the death events which has substring 'East'?
Output: SELECT note FROM death WHERE note LIKE '%East%'
What is the first and second line for all addresses?
Output: SELECT line_1 ,  line_2 FROM addresses
For each department id, what is the name of the department with the most number of degrees?
Output: SELECT T2.department_name ,  T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY T1.department_id ORDER BY count(*) DESC LIMIT 1
How many degrees does the engineering department have?
Output: SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id  =  T2.department_id WHERE T1.department_name  =  'engineer'
What are the first, middle, and last names for everybody enrolled in a Bachelors program?
Output: SELECT DISTINCT T1.first_name ,  T1.middle_name ,  T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id  =  T3.degree_program_id WHERE T3.degree_summary_name  =  'Bachelor'
What is the degree summary name that has the most number of students enrolled?
Output: SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY count(*) DESC LIMIT 1
What are all the course names of the courses which ever have students enrolled in?
Output: SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id  =  T2.course_id
What's the name of the course with most number of enrollments?
Output: SELECT  T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY count(*) DESC LIMIT 1
Show the date and id of the transcript with at least 2 course results.
Output: SELECT T2.transcript_date ,  T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id  =  T2.transcript_id GROUP BY T1.transcript_id HAVING count(*)  >=  2
Which address holds the most number of students currently? List the address id and all lines.
Output: SELECT T1.address_id ,  T1.line_1 ,  T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.current_address_id GROUP BY T1.address_id ORDER BY count(*) DESC LIMIT 1
Show the date of the transcript which shows the least number of results, also list the id.
Output: SELECT T2.transcript_date ,  T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id  =  T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1
Find the semester when both Master students and Bachelor students got enrolled in.
Output: SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Bachelor'
How many different addresses do the students currently live?
Output: SELECT count(DISTINCT current_address_id) FROM Students
What are the first names of the students who live in Haiti permanently or have the cell phone number 09700166582?
Output: SELECT T1.first_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.permanent_address_id  =  T2.address_id WHERE T2.country  =  'Haiti' UNION SELECT first_name FROM Students WHERE cell_mobile_number  =  '09700166582'
What is the TV Channel that shows the cartoon "The Rise of the Blue Beetle!"? List the TV Channel's series name.
Output: SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!"
When did the episode "A Love of a Lifetime" air?
Output: SELECT Air_Date FROM TV_series WHERE Episode = "A Love of a Lifetime"
What is the produdction code and channel of the most recent cartoon?
Output: SELECT production_code ,  channel FROM cartoon ORDER BY original_air_date LIMIT 1
What are the ids of all tv channels that have more than 2 TV channels?
Output: SELECT id FROM tv_channel GROUP BY country HAVING count(*)  >  2
Return the names of all the poker players.
Output: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID  =  T2.People_ID
What are the contestant numbers and names of the contestants who had at least two votes?
Output: SELECT T1.contestant_number , T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number  =  T2.contestant_number GROUP BY T1.contestant_number HAVING count(*)  >=  2
Which continent is Anguilla in?
Output: SELECT Continent FROM country WHERE Name  =  "Anguilla"
What language is predominantly spoken in Aruba?
Output: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T1.Name  =  "Aruba" ORDER BY Percentage DESC LIMIT 1
Give me Brazil’s population and life expectancies.
Output: SELECT Population ,  LifeExpectancy FROM country WHERE Name  =  "Brazil"
What is the name of country that has the shortest life expectancy in Asia?
Output: SELECT Name FROM country WHERE Continent  =  "Asia" ORDER BY LifeExpectancy LIMIT 1
How many people live in Asia, and what is the largest GNP among them?
Output: SELECT sum(Population) ,  max(GNP) FROM country WHERE Continent  =  "Asia"
What is the average life expectancy in African countries that are republics?
Output: SELECT avg(LifeExpectancy) FROM country WHERE Continent  =  "Africa" AND GovernmentForm  =  "Republic"
What is the total population of Gelderland district?
Output: SELECT sum(Population) FROM city WHERE District  =  "Gelderland"
Give the mean GNP and total population of nations which are considered US territory.
Output: SELECT avg(GNP) ,  sum(population) FROM country WHERE GovernmentForm  =  "US Territory"
What is the total number of languages used in Aruba?
Output: SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T1.Name  =  "Aruba"
What is name of the country that speaks the largest number of languages?
Output: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode GROUP BY T1.Name ORDER BY COUNT(*) DESC LIMIT 1
Which continent has the most diverse languages?
Output: SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1
How many countries speak both English and Dutch?
Output: SELECT COUNT(*) FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "Dutch")
Give the names of countries with English and French as official languages.
Output: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "English" AND T2.IsOfficial  =  "T" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "French" AND T2.IsOfficial  =  "T"
What are the countries where either English or Dutch is the official language?
Output: SELECT * FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "English" AND IsOfficial  =  "T" UNION SELECT * FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "Dutch" AND IsOfficial  =  "T"
What are the name, population, and life expectancy of the largest Asian country by land?
Output: SELECT Name ,  Population ,  LifeExpectancy FROM country WHERE Continent  =  "Asia" ORDER BY SurfaceArea DESC LIMIT 1
Give the mean life expectancy of countries in which English is not the official language.
Output: SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "English" AND T2.IsOfficial  =  "T")
What is the total number of people living in the nations that do not use English?
Output: SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "English")
What is the official language spoken in the country whose head of state is Beatrix?
Output: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T1.HeadOfState  =  "Beatrix" AND T2.IsOfficial  =  "T"
What is the total number of unique official languages spoken in the countries that are founded before 1930?
Output: SELECT count(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE  IndepYear  <  1930 AND T2.IsOfficial  =  "T"
What are the countries that have greater surface area than any country in Europe?
Output: SELECT Name FROM country WHERE SurfaceArea  >  (SELECT min(SurfaceArea) FROM country WHERE Continent  =  "Europe")
Which African countries have a smaller population than that of any country in Asia?
Output: SELECT Name FROM country WHERE Continent  =  "Africa"  AND population  <  (SELECT min(population) FROM country WHERE Continent  =  "Asia")
What are the country codes for countries that do not speak English?
Output: SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE  =  "English"
What are the country codes of countries where people use languages other than English?
Output: SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE != "English"
What are the codes of the countries that do not speak English and whose government forms are not Republic?
Output: SELECT Code FROM country WHERE GovernmentForm != "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE  =  "English"
Which cities are in European countries where English is not the official language?
Output: SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode  =  T1.Code WHERE T1.Continent  =  'Europe' AND T1.Name NOT IN (SELECT T3.Name FROM country AS T3 JOIN countrylanguage AS T4 ON T3.Code  =  T4.CountryCode WHERE T4.IsOfficial  =  'T' AND T4.Language  =  'English')
Whic`h unique cities are in  Asian countries where Chinese is the official language?
Output: SELECT DISTINCT T3.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode JOIN city AS T3 ON T1.Code  =  T3.CountryCode WHERE T2.IsOfficial  =  'T' AND T2.Language  =  'Chinese' AND T1.Continent  =  "Asia"
What are the population, name and leader of the country with the largest area?
Output: SELECT Name ,  population ,  HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1
What are the different government forms and what is the total population of each for government forms that have an average life expectancy greater than 72?
Output: SELECT sum(Population) ,  GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy)  >  72
Find the average life expectancy and total population for each continent where the average life expectancy is shorter than 72?
Output: SELECT sum(Population) ,  avg(LifeExpectancy) ,  Continent FROM country GROUP BY Continent HAVING avg(LifeExpectancy)  <  72
What are the names and areas of countries with the top 5 largest area?
Output: SELECT Name ,  SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5
What is the total population and average area of countries in the continent of North America whose area is bigger than 3000？
Output: SELECT sum(Population) ,  avg(SurfaceArea) FROM country WHERE Continent  =  "North America" AND SurfaceArea  >  3000
What is the language spoken by the largest percentage of people in each country?
Output: SELECT LANGUAGE ,  CountryCode ,  max(Percentage) FROM countrylanguage GROUP BY CountryCode
Count the number of countries for which Spanish is the predominantly spoken language.
Output: SELECT count(*) ,   max(Percentage) FROM countrylanguage WHERE LANGUAGE  =  "Spanish" GROUP BY CountryCode
What are the codes of countries where Spanish is spoken by the largest percentage of people?
Output: SELECT CountryCode ,  max(Percentage) FROM countrylanguage WHERE LANGUAGE  =  "Spanish" GROUP BY CountryCode
What are the names of conductors who have conducted at more than one orchestra?
Output: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID  =  T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*)  >  1
Show the names of high school students and their corresponding number of friends.
Output: SELECT T2.name ,  count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id GROUP BY T1.student_id
What are the names of high schoolers who have 3 or more friends?
Output: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id GROUP BY T1.student_id HAVING count(*)  >=  3
Return the names of friends of the high school student Kyle.
Output: SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id JOIN Highschooler AS T3 ON T1.friend_id  =  T3.id WHERE T2.name  =  "Kyle"
What are the names of high schoolers who both have friends and are liked?
Output: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id  =  T2.id
What are the names of high schoolers who have likes, and how many likes does each have?
Output: SELECT T2.name ,  count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id GROUP BY T1.student_id
What is the name of the high schooler who has the greatest number of likes?
Output: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
What are the names of high schoolers who have a grade of over 5 and have 2 or more friends?
Output: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id WHERE T2.grade  >  5 GROUP BY T1.student_id HAVING count(*)  >=  2
Find the states where both owners and professionals live.
Output: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
What is the average age of the dogs who have gone through any treatments?
Output: SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )
Which dogs have not cost their owner more than 1000 for treatment? List the dog names.
Output: SELECT name FROM Dogs WHERE dog_id NOT IN( SELECT dog_id FROM Treatments GROUP BY dog_id HAVING sum(cost_of_treatment)  >  1000 )
Which professional did not operate any treatment on dogs? List the professional's id, role and email.
Output: SELECT professional_id ,  role_code ,  email_address FROM Professionals EXCEPT SELECT T1.professional_id ,  T1.role_code ,  T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id
Which professionals have done at least two treatments? List the professional's id, role, and first name.
Output: SELECT T1.professional_id ,  T1.role_code ,  T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id GROUP BY T1.professional_id HAVING count(*)  >=  2
Which owner has paid for the most treatments on his or her dogs? List the owner id and last name.
Output: SELECT T1.owner_id ,  T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id  =  T2.owner_id JOIN Treatments AS T3 ON T2.dog_id  =  T3.dog_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1
What is the description of the treatment type that costs the least money in total?
Output: SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code  =  T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1
Which owner has paid the largest amount of money in total for their dogs? Show the owner id and zip code.
Output: SELECT T1.owner_id ,  T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id  =  T2.owner_id JOIN Treatments AS T3 ON T2.dog_id  =  T3.dog_id GROUP BY T1.owner_id ORDER BY sum(T3.cost_of_treatment) DESC LIMIT 1
Which dogs are of the rarest breed? Show their names and treatment dates.
Output: SELECT T1.name ,  T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id  =  T2.dog_id WHERE T1.breed_code  =  ( SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY count(*) ASC LIMIT 1 )
What are the arriving date and the departing date of the dogs who have gone through a treatment?
Output: SELECT DISTINCT T1.date_arrived ,  T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id  =  T2.dog_id
Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state.
Output: SELECT role_code ,  street ,  city ,  state FROM professionals WHERE city LIKE '%West%'
Tell me the number of dogs that have received any treatment.
Output: SELECT count(*) FROM Dogs WHERE dog_id NOT IN ( SELECT dog_id FROM Treatments )
What is the age of the oldest dog?
Output: SELECT max(age) FROM Dogs
How much does the most expensive charge type costs?
Output: SELECT max(charge_amount) FROM Charges
What are each professional's first name and description of the treatment they have performed?
Output: SELECT DISTINCT T1.first_name ,  T3.treatment_type_description FROM professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id JOIN Treatment_types AS T3 ON T2.treatment_type_code  =  T3.treatment_type_code
Show the names of singers that have more than one song.
Output: SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*)  >  1
What is the number of faculty at Long Beach State University in 2002?
Output: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus  =  T2.id WHERE T1.year  =  2002 AND T2.campus  =  "Long Beach State University"
Find the most prominent max page size among all the products.
Output: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1
How many lessons did the customer Ryan Goodwin complete?
Output: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id  = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed"
What campuses are located in Los Angeles county and opened after 1950?
Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles" AND YEAR  >  1950
In what city does Janessa Sawayn live?
Output: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
Show ids for all transactions whose amounts are greater than the average.
Output: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
What are the first and last names of all customers with more than 2 payments?
Output: SELECT T2.first_name ,  T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >  2
Find the names of all reviewers who have ratings with a NULL value for the date.
Output: SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID  =  T2.rID WHERE ratingDate  =  "null"
What are the names of body builders?
Output: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID
Show the total number of rooms of the apartments in the building with short name "Columbus Square".
Output: SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id  =  T2.building_id WHERE T1.building_short_name  =  "Columbus Square"
What are the ids, date opened, name, and other details for all accounts?
Output: SELECT account_id ,  date_account_opened ,  account_name ,  other_account_details FROM Accounts
Find all the distinct district names ordered by city area in descending.
Output: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC
How many distinct order ids correspond to each product?
Output: SELECT product_id ,  count(DISTINCT order_id) FROM Order_items GROUP BY product_id
What are the apartment number and the room count of each apartment?
Output: SELECT apt_number ,  room_count FROM Apartments
Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female".
Output: SELECT T1.booking_start_date ,  T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id  =  T2.guest_id WHERE T2.gender_code  =  "Female"
Find the texts of assessment notes for teachers with last name "Schuster".
Output: SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.last_name  =  "Schuster"
Which year has the most degrees conferred?
Output: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY sum(degrees) DESC LIMIT 1
What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled?
Output: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id  =  t2.campus WHERE t2.year  =  1956 AND totalenrollment_ay  >  400 AND FTE_AY  >  200
What is the average number of bedrooms of all apartments?
Output: SELECT avg(bedroom_count) FROM Apartments
Show all product names and the total quantity ordered for each product name.
Output: SELECT T2.product_name ,  sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id GROUP BY T2.product_name
List all information about the assessment notes sorted by date in ascending order.
Output: SELECT * FROM Assessment_Notes ORDER BY date_of_notes ASC
What campuses are in Los Angeles county?
Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles"
What are the names of all movies that received 3 or 4 stars?
Output: SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE T1.stars  =  3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE T1.stars  =  4
What is the campus fee for San Jose State University in 1996?
Output: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id  =  t2.campus WHERE t1.campus  =  "San Jose State University" AND T2.year  =  1996
Which campus was opened between 1935 and 1939?
Output: SELECT campus FROM campuses WHERE YEAR  >=  1935 AND YEAR  <=  1939
What is the average snatch score of body builders?
Output: SELECT avg(Snatch) FROM body_builder
Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings.
Output: SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id  =  T2.building_id WHERE T2.bathroom_count  >  2
What are the total scores of the body builders whose birthday contains the string "January" ?
Output: SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id  =  T2.people_id WHERE T2.Birth_Date LIKE "%January%"
Which apartments have unit status availability of both 0 and 1? Return their apartment numbers.
Output: SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.available_yn  =  0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.available_yn  =  1
Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.
Output: SELECT Hardware_Model_name ,  Company_name FROM phone WHERE Accreditation_type LIKE 'Full'
Which apartment type code is the most common among apartments with more than one bathroom?
Output: SELECT apt_type_code FROM Apartments WHERE bathroom_count  >  1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Count the number of chip model that do not have wifi.
Output: SELECT count(*) FROM chip_model WHERE wifi  =  'No'
Which city does has most number of customers?
Output: SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1
What is the id of the reviewer whose name includes the word "Mike"?
Output: SELECT rID FROM Reviewer WHERE name LIKE "%Mike%"
What are the names of all directors who have made one movie except for the director named NULL?
Output: SELECT director FROM Movie WHERE director != "null" GROUP BY director HAVING count(*)  =  1
List the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics."
Output: SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics" OR t2.Company_name  =  "Nokia Corporation"
Find the booking start date and end date for the apartments that have more than two bedrooms.
Output: SELECT T1.booking_start_date ,  T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.bedroom_count  >  2
What is the invoice number and invoice date for the invoice with most number of transactions?
Output: SELECT T2.invoice_number ,  T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1
What is the reviewer name, film title, movie rating, and rating date  for every movie ordered by reviewer name, movie title, then finally rating?
Output: SELECT T3.name ,  T2.title ,  T1.stars ,  T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID JOIN Reviewer AS T3 ON T1.rID  =  T3.rID ORDER BY T3.name ,  T2.title ,  T1.stars
What are the different product sizes?
Output: SELECT DISTINCT product_size FROM Products
Count the number of financial transactions that the account with the name 337 has.
Output: SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id WHERE T2.account_name  =  "337"
What are the clean and jerk score of the body builder with the highest total score?
Output: SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
Which city lives most of staffs? List the city name and number of staffs.
Output: SELECT T1.city ,  count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1
For each director, what is the title and score of their most poorly rated movie?
Output: SELECT T2.title ,  T1.stars ,  T2.director ,  min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID GROUP BY T2.director
Find the average rating star for each movie that received at least 2 ratings.
Output: SELECT mID ,  avg(stars) FROM Rating GROUP BY mID HAVING count(*)  >=  2
What are the line 1 of addresses shared by some students and some teachers?
Output: SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id
Find the name of the products that are not using the most frequently-used max page size.
Output: SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1)
What is the name of the body builder with the greatest body weight?
Output: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
Return the apartment number with the largest number of bedrooms.
Output: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1
What is the average fee on a CSU campus in 2005?
Output: SELECT avg(campusfee) FROM csu_fees WHERE YEAR  =  2005
Return all reviewer names and movie names together in a single list.
Output: SELECT name FROM Reviewer UNION SELECT title FROM Movie
List the snatch score and clean jerk score of body builders in ascending order of snatch score.
Output: SELECT Snatch ,  Clean_Jerk FROM body_builder ORDER BY Snatch ASC
How many lessons did the customer with the first name Ray take?
Output: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id  = T2.customer_id WHERE T2.first_name = "Ray"
What is the number of graduates in "San Francisco State University" in year 2004?
Output: SELECT sum(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus  =  t2.id WHERE t1.year  =  2004 AND t2.campus  =  "San Francisco State University"
What are the names of all movies that were created after the most recent Steven Spielberg film?
Output: SELECT title FROM Movie WHERE YEAR  >  (SELECT max(YEAR) FROM Movie WHERE director  =  "Steven Spielberg")
Find the number of stores in each city.
Output: SELECT t3.headquartered_city ,  count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id GROUP BY t3.headquartered_city
Sort the apartment numbers in ascending order of room count.
Output: SELECT apt_number FROM Apartments ORDER BY room_count ASC
What are the names of all reviewers that have rated 3 or more movies?
Output: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID  =  T2.rID GROUP BY T1.rID HAVING COUNT(*)  >=  3
Find the list of page size which have more than 3 product listed
Output: SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*)  >  3
What is the minimum snatch score?
Output: SELECT min(snatch) FROM body_builder
Find all the building full names containing the word "court".
Output: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%"
Which campus has the most degrees conferred in all times?
Output: SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1
What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?
Output: SELECT phone_number ,  email_address FROM Customers WHERE amount_outstanding  >  2000
What degrees were conferred in San Francisco State University in the year 2001?
Output: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id  =  t2.campus WHERE t1.campus  =  "San Francisco State University" AND t2.year  =  2001
What city is the headquarter of the store Blackville?
Output: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.store_name  =  "Blackville"
What are the code and description of the least frequent detention type ?
Output: SELECT T1.detention_type_code ,  T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code  =  T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1
Find the names of the chip models that are not used by any phone with full accreditation type.
Output: SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type  =  'Full'
What are the code and description of the most frequent behavior incident type?
Output: SELECT T1.incident_type_code ,  T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code  =  T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1
What are the address and phone number of the buildings managed by "Brenden"?
Output: SELECT building_address ,  building_phone FROM Apartment_Buildings WHERE building_manager	 =  "Brenden"
List the hardware model name for the phones that have screen mode type "Text" or RAM size greater than 32.
Output: SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB  >  32
What is the minimum and maximum number of bathrooms of all the apartments?
Output: SELECT min(bathroom_count) ,  max(bathroom_count) FROM Apartments
What are the names of the directors who created a movie with a 5 star rating, and what was the name of those movies?
Output: SELECT T1.director ,  T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID  =  T2.mID WHERE T2.stars  =  5
Find products with max page size as "A4" or pages per minute color smaller than 5.
Output: SELECT product FROM product WHERE max_page_size  =  "A4" OR pages_per_minute_color  <  5
List the name of the phone model launched in year 2002 and with the highest RAM size.
Output: SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1
What is the average ROM size of phones produced by the company named "Nokia Corporation"?
Output: SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation"
How many accounts are there?
Output: SELECT count(*) FROM Accounts
What apartment type codes and apartment numbers do the buildings managed by "Kyle" have?
Output: SELECT T2.apt_type_code ,  T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id  =  T2.building_id WHERE T1.building_manager  =  "Kyle"
What is the total number of ratings that has more than 3 stars?
Output: SELECT count(*) FROM Rating WHERE stars  >  3
What are the first and last names of all customers who lived in Lockmanfurt?
Output: SELECT T1.first_name ,  T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt"
How many employees are there?
Output: SELECT count(*) FROM Staff
How many vehicles exist?
Output: SELECT count(*) FROM Vehicles
What is the customer last name, id and phone number with most number of orders?
Output: SELECT T2.customer_last_name ,  T1.customer_id ,  T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1