minktn/spider-data huggingface dataset:
Database: art_1
Question: What are the locations that have works painted before 1885 and after 1930?
SQL: SELECT DISTINCT LOCATION FROM paintings WHERE YEAR  <  1885 INTERSECT SELECT DISTINCT LOCATION FROM paintings WHERE YEAR  >  1930
Database: art_1
Question: What are the average height and width of paintings that are oil medium in the place of gallery 241?
SQL: SELECT avg(height_mm) ,  avg(width_mm) FROM paintings WHERE medium  =  "oil" AND LOCATION  =  "Gallery 241"
Database: art_1
Question: What is the average height and width of paintings that are oil medium in gallery 241?
SQL: SELECT avg(height_mm) ,  avg(width_mm) FROM paintings WHERE medium  =  "oil" AND LOCATION  =  "Gallery 241"
Database: art_1
Question: What are the maximum height and id of paintings painted before 1900?
SQL: SELECT max(height_mm) ,  paintingID FROM paintings WHERE YEAR  <  1900
Database: art_1
Question: What is the height and id of the tallest painting created before 1900?
SQL: SELECT max(height_mm) ,  paintingID FROM paintings WHERE YEAR  <  1900
Database: art_1
Question: What are the maximum height and width of paintings for each year?
SQL: SELECT max(height_mm) ,  max(width_mm) ,  YEAR FROM paintings GROUP BY YEAR ORDER BY YEAR
Database: art_1
Question: What are largest height and width dimensions for paintings in each year?
SQL: SELECT max(height_mm) ,  max(width_mm) ,  YEAR FROM paintings GROUP BY YEAR ORDER BY YEAR
Database: art_1
Question: What are the average height and width of paintings grouped by painters and ordered by name?
SQL: SELECT avg(height_mm) ,  avg(width_mm) ,  painterID FROM paintings GROUP BY painterID ORDER BY title
Database: art_1
Question: Find the average height and width of paintings grouped by painters and ordered by name
SQL: SELECT avg(height_mm) ,  avg(width_mm) ,  painterID FROM paintings GROUP BY painterID ORDER BY title
Database: art_1
Question: Find the first names and number of works of all artists who have at least two paintings?
SQL: SELECT T1.fname ,  count(*) FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID GROUP BY T2.painterID HAVING count(*)  >=  2
Database: art_1
Question: What are the first names of all artists who have at least two paintings, and how many works did each create?
SQL: SELECT T1.fname ,  count(*) FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID GROUP BY T2.painterID HAVING count(*)  >=  2
Database: art_1
Question: Find the death year of all artists who have at most 3 paintings?
SQL: SELECT T1.deathYear FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID GROUP BY T2.painterID HAVING count(*)  <=  3
Database: art_1
Question: When did each artist who created less than 4 paintings die ?
SQL: select t1.deathyear from artists as t1 join paintings as t2 on t1.artistid  =  t2.painterid group by t2.painterid having count(*)  <  4
Database: art_1
Question: Find the death year of the artist who made the least number of sculptures?
SQL: SELECT T1.deathYear FROM artists AS T1 JOIN sculptures AS T2 ON T1.artistID  =  T2.sculptorID GROUP BY T2.sculptorID ORDER BY count(*) LIMIT 1
Database: art_1
Question: When did the artist who made the fewest sculptures die?
SQL: SELECT T1.deathYear FROM artists AS T1 JOIN sculptures AS T2 ON T1.artistID  =  T2.sculptorID GROUP BY T2.sculptorID ORDER BY count(*) LIMIT 1
Database: art_1
Question: What are the id and height of the painting with the longest width in gallery 240?
SQL: SELECT paintingID ,  height_mm FROM paintings WHERE LOCATION  =  'Gallery 240' ORDER BY width_mm DESC LIMIT 1
Database: art_1
Question: Tell me the height and id number of the widest painting in gallery 240.
SQL: SELECT paintingID ,  height_mm FROM paintings WHERE LOCATION  =  'Gallery 240' ORDER BY width_mm DESC LIMIT 1
Database: art_1
Question: What are the ids of the paintings created before all of the paintings in gallery 240?
SQL: SELECT paintingID FROM paintings WHERE YEAR  <   (SELECT min(YEAR) FROM paintings WHERE LOCATION  =  'Gallery 240')
Database: art_1
Question: What is the id of every painting created before the oldest painting in gallery 240?
SQL: SELECT paintingID FROM paintings WHERE YEAR  <   (SELECT min(YEAR) FROM paintings WHERE LOCATION  =  'Gallery 240')
Database: art_1
Question: What are the ids of the paintings whose height is longer than the height of all paintings created after 1900?
SQL: SELECT paintingID FROM paintings WHERE height_mm  >   (SELECT max(height_mm) FROM paintings WHERE YEAR  >  1900)
Database: art_1
Question: List the ids of all paintings that are taller than the longest painting created after 1900.
SQL: SELECT paintingID FROM paintings WHERE height_mm  >   (SELECT max(height_mm) FROM paintings WHERE YEAR  >  1900)
Database: art_1
Question: Find the top 3 artists who have the biggest number of painting works whose medium is oil?
SQL: SELECT T1.lname ,  T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID WHERE T2.medium  =  "oil" GROUP BY T2.painterID ORDER BY count(*) DESC LIMIT 3
Database: art_1
Question: Which artists have the most paintings in oil?
SQL: SELECT T1.lname ,  T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID WHERE T2.medium  =  "oil" GROUP BY T2.painterID ORDER BY count(*) DESC LIMIT 3
Database: art_1
Question: List the painting id, location and title of the medium oil paintings ordered by year.
SQL: SELECT paintingID ,  title ,  LOCATION FROM paintings WHERE medium  =  "oil" ORDER BY YEAR
Database: art_1
Question: Order all of the oil paintings by date of creation and list their ids, locations, and titles.
SQL: SELECT paintingID ,  title ,  LOCATION FROM paintings WHERE medium  =  "oil" ORDER BY YEAR
Database: art_1
Question: List the year, location and title of paintings whose height is longer than 1000 ordered by title.
SQL: SELECT title ,  LOCATION ,  YEAR FROM paintings WHERE height_mm  >  1000 ORDER BY title
Database: art_1
Question: List the year, location, and name of all paintings that are taller than 1000 in alphabetical order.
SQL: SELECT title ,  LOCATION ,  YEAR FROM paintings WHERE height_mm  >  1000 ORDER BY title
Database: art_1
Question: Find the first and last name of artists who have painting but no sculpture work.
SQL: SELECT T1.lname ,  T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID EXCEPT SELECT T3.lname ,  T3.fname FROM artists AS T3 JOIN sculptures AS T4 ON T3.artistID  =  T4.sculptorID
Database: art_1
Question: What are the first and last names of the artists who did not sculpt but could paint.
SQL: SELECT T1.lname ,  T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID EXCEPT SELECT T3.lname ,  T3.fname FROM artists AS T3 JOIN sculptures AS T4 ON T3.artistID  =  T4.sculptorID
Database: art_1
Question: Find the locations that have paintings before 1885 and no work with medium on canvas?
SQL: SELECT DISTINCT LOCATION FROM paintings WHERE YEAR  <  1885 AND mediumOn != "canvas"
Database: art_1
Question: Where do you have paintings that were created before 1885 that are not on canvas?
SQL: SELECT DISTINCT LOCATION FROM paintings WHERE YEAR  <  1885 AND mediumOn != "canvas"
Database: car_road_race
Question: How many races are there?
SQL: SELECT count(*) FROM race
Database: car_road_race
Question: Count the number of races.
SQL: SELECT count(*) FROM race
Database: car_road_race
Question: List the winning drivers and winning teams of races in ascending alphabetical order of winning team.
SQL: SELECT Winning_driver ,  Winning_team FROM race ORDER BY Winning_team ASC
Database: car_road_race
Question: What are the winning drivers and teams of races, ordered alphabetically by team?
SQL: SELECT Winning_driver ,  Winning_team FROM race ORDER BY Winning_team ASC
Database: car_road_race
Question: Which winning drivers of races had pole position that is not "Junior Strous"?
SQL: SELECT Winning_driver FROM race WHERE Pole_Position != 'Junior Strous'
Database: car_road_race
Question: Return the winning drivers of races who did not have the pole position of Junior Strous.
SQL: SELECT Winning_driver FROM race WHERE Pole_Position != 'Junior Strous'
Database: car_road_race
Question: Who are the constructors of drivers sorted by drivers' age in ascending order?
SQL: SELECT DISTINCT CONSTRUCTOR FROM driver ORDER BY Age ASC
Database: car_road_race
Question: Return the different constructors of drivers, ordered by age ascending.
SQL: SELECT DISTINCT CONSTRUCTOR FROM driver ORDER BY Age ASC
Database: car_road_race
Question: What are the distinct entrant types of drivers aged 20 or older?
SQL: SELECT DISTINCT Entrant FROM driver WHERE Age  >=  20
Database: car_road_race
Question: Give the different entrant types for drivers at least 20 years old.
SQL: SELECT DISTINCT Entrant FROM driver WHERE Age  >=  20
Database: car_road_race
Question: What are the maximum and minimum age of driver?
SQL: SELECT max(Age) ,  min(Age) FROM driver
Database: car_road_race
Question: Return the maximum and minimum age across drivers.
SQL: SELECT max(Age) ,  min(Age) FROM driver
Database: car_road_race
Question: How many different engines are used by drivers with age older than 30 or younger than 20?
SQL: SELECT count(DISTINCT Engine) FROM driver WHERE Age  >  30 OR Age  <  20
Database: car_road_race
Question: Count the number of different engines used by drivers who had an age either over 30 or under 20.
SQL: SELECT count(DISTINCT Engine) FROM driver WHERE Age  >  30 OR Age  <  20
Database: car_road_race
Question: List all names of drivers in descending alphabetical order.
SQL: SELECT Driver_Name FROM driver ORDER BY Driver_Name DESC
Database: car_road_race
Question: What are the names of drivers, ordered descending alphabetically?
SQL: SELECT Driver_Name FROM driver ORDER BY Driver_Name DESC
Database: car_road_race
Question: Please show the names of drivers and the names of races they participate in.
SQL: SELECT T1.Driver_Name ,  T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID
Database: car_road_race
Question: What are the names of drivers and the names of the races they took part in?
SQL: SELECT T1.Driver_Name ,  T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID
Database: car_road_race
Question: Please show the names of drivers and the number of races they participate in.
SQL: SELECT T1.Driver_Name ,  COUNT(*) FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID
Database: car_road_race
Question: How many races did each driver participate in?
SQL: SELECT T1.Driver_Name ,  COUNT(*) FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID
Database: car_road_race
Question: Please show the age of the driver who participated in the most number of races.
SQL: SELECT T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID ORDER BY COUNT(*) DESC LIMIT 1
Database: car_road_race
Question: What is the age of the driver who raced in the most races?
SQL: SELECT T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID ORDER BY COUNT(*) DESC LIMIT 1
Database: car_road_race
Question: Please show the names and ages of the drivers who participated in at least two races.
SQL: SELECT T1.Driver_Name ,  T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID HAVING COUNT(*)  >=  2
Database: car_road_race
Question: What are the names and ages of drivers who raced in two or more races?
SQL: SELECT T1.Driver_Name ,  T1.Age FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID HAVING COUNT(*)  >=  2
Database: car_road_race
Question: Please list the names of races with drivers aged 26 or older participating.
SQL: SELECT T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE T1.Age  >=  26
Database: car_road_race
Question: What are the names of races in which drivers 26 or older took part?
SQL: SELECT T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE T1.Age  >=  26
Database: car_road_race
Question: List the names of drivers whose constructor is not "Bugatti".
SQL: SELECT Driver_Name FROM driver WHERE CONSTRUCTOR != "Bugatti"
Database: car_road_race
Question: What are the names od drivers who did not have the constructor Bugatti?
SQL: SELECT Driver_Name FROM driver WHERE CONSTRUCTOR != "Bugatti"
Database: car_road_race
Question: List different constructors and the number of drivers that use each constructor.
SQL: SELECT CONSTRUCTOR ,  COUNT(*) FROM driver GROUP BY CONSTRUCTOR
Database: car_road_race
Question: How many drivers use each constructor?
SQL: SELECT CONSTRUCTOR ,  COUNT(*) FROM driver GROUP BY CONSTRUCTOR
Database: car_road_race
Question: List the most common type of engine used by drivers.
SQL: SELECT Engine FROM driver GROUP BY Engine ORDER BY COUNT(*) DESC LIMIT 1
Database: car_road_race
Question: What is the most common type of engine?
SQL: SELECT Engine FROM driver GROUP BY Engine ORDER BY COUNT(*) DESC LIMIT 1
Database: car_road_race
Question: List the types of engines that are used by at least two drivers.
SQL: SELECT Engine FROM driver GROUP BY Engine HAVING COUNT(*)  >=  2
Database: car_road_race
Question: What are the engine types that are used by two or more drivers?
SQL: SELECT Engine FROM driver GROUP BY Engine HAVING COUNT(*)  >=  2
Database: car_road_race
Question: List the names of drivers that do not participate in any race.
SQL: SELECT Driver_Name FROM driver WHERE Driver_ID NOT IN (SELECT Driver_ID FROM race)
Database: car_road_race
Question: What are names of drivers who did not take part in a race?
SQL: SELECT Driver_Name FROM driver WHERE Driver_ID NOT IN (SELECT Driver_ID FROM race)
Database: car_road_race
Question: Show the constructors that are used both by drivers with age lower than 20 and drivers with age over than 30.
SQL: SELECT CONSTRUCTOR FROM driver WHERE Age  <  20 INTERSECT SELECT CONSTRUCTOR FROM driver WHERE Age  >  30
Database: car_road_race
Question: What are the constructors who are used by both drivers who are younger than 20 and drivers older than 30?
SQL: SELECT CONSTRUCTOR FROM driver WHERE Age  <  20 INTERSECT SELECT CONSTRUCTOR FROM driver WHERE Age  >  30
Database: car_road_race
Question: Find the teams that won more than once.
SQL: SELECT Winning_team FROM race GROUP BY Winning_team HAVING count(*)  >  1
Database: car_road_race
Question: Which teams won more than 1 race?
SQL: SELECT Winning_team FROM race GROUP BY Winning_team HAVING count(*)  >  1
Database: car_road_race
Question: Find the names of drivers who were in both "James Hinchcliffe" and "Carl Skerlong" pole positions before.
SQL: SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE Pole_Position  =  "Carl Skerlong" INTERSECT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE Pole_Position  =  "James Hinchcliffe"
Database: car_road_race
Question: What are the names of drivers who had both the pole position James Hinchcliffe and the pole position Carl Skerlong?
SQL: SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE Pole_Position  =  "Carl Skerlong" INTERSECT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE Pole_Position  =  "James Hinchcliffe"
Database: car_road_race
Question: find the name of drivers who were never in "James Hinchcliffe" pole position before.
SQL: SELECT Driver_Name FROM driver EXCEPT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE Pole_Position  =  "James Hinchcliffe"
Database: car_road_race
Question: What are the names of drivers except for those who had the pole position James Hinchcliffe?
SQL: SELECT Driver_Name FROM driver EXCEPT SELECT T1.Driver_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID WHERE Pole_Position  =  "James Hinchcliffe"
Database: country_language
Question: How many languages are there?
SQL: SELECT count(*) FROM languages
Database: country_language
Question: Count the number of languages.
SQL: SELECT count(*) FROM languages
Database: country_language
Question: List the name of languages in ascending alphabetical order.
SQL: SELECT name FROM languages ORDER BY name ASC
Database: country_language
Question: What are the names of languages, in alphabetical order?
SQL: SELECT name FROM languages ORDER BY name ASC
Database: country_language
Question: What are the names of languages that contain the word "ish"?
SQL: SELECT name FROM languages WHERE name LIKE "%ish%"
Database: country_language
Question: Return the names of langauges that contain the substring "ish".
SQL: SELECT name FROM languages WHERE name LIKE "%ish%"
Database: country_language
Question: Show the names of countries in descending order of overall scores.
SQL: SELECT name FROM countries ORDER BY overall_score DESC
Database: country_language
Question: What are the names of the countries, ordered descending by overall score?
SQL: SELECT name FROM countries ORDER BY overall_score DESC
Database: country_language
Question: What is the average justice scores among countries?
SQL: SELECT avg(justice_score) FROM countries
Database: country_language
Question: Give the average justice scores across all countries.
SQL: SELECT avg(justice_score) FROM countries
Database: country_language
Question: What are the maximum and minimum health scores among countries that are not "Norway".
SQL: SELECT max(health_score) ,  min(health_score) FROM countries WHERE name != "Norway"
Database: country_language
Question: Return the maximum and minimum health scores across all countries other than Norway.
SQL: SELECT max(health_score) ,  min(health_score) FROM countries WHERE name != "Norway"
Database: country_language
Question: How many different official languages are there?
SQL: SELECT count(DISTINCT language_id) FROM official_languages
Database: country_language
Question: Count the number of different official languages.
SQL: SELECT count(DISTINCT language_id) FROM official_languages
Database: country_language
Question: List names of countries in descending order of education_score.
SQL: SELECT name FROM countries ORDER BY education_score DESC
Database: country_language
Question: What are the names of the countries, ordered descending by education score?
SQL: SELECT name FROM countries ORDER BY education_score DESC
Database: country_language
Question: List the name of the country with the biggest score in politics.
SQL: SELECT name FROM countries ORDER BY politics_score DESC LIMIT 1
Database: country_language
Question: What is the name of the country with the highest politics score?
SQL: SELECT name FROM countries ORDER BY politics_score DESC LIMIT 1
Database: country_language
Question: Show the names of countries and their official languages.
SQL: SELECT T1.name ,  T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id
Database: country_language
Question: What are the names of the countries, as well as the names of their official langauges?
SQL: SELECT T1.name ,  T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id
Database: country_language
Question: Show the official languages and the number of countries speaking each language.
SQL: SELECT T2.name ,  COUNT(*) FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.name
Database: country_language
Question: What are the names of the different official languages, as well as the number of countries that speak each?
SQL: SELECT T2.name ,  COUNT(*) FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.name
Database: country_language
Question: Show the official language spoken by the most number of countries.
SQL: SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1
Database: country_language
Question: What is the official language that is most common?
SQL: SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1
Database: country_language
Question: Show the official languages spoken by at least two countries.
SQL: SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.id HAVING COUNT(*)  >=  2
Database: country_language
Question: Which official languages are spoken in two or more countries?
SQL: SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.id HAVING COUNT(*)  >=  2
Database: country_language
Question: Show the average overall scores of countries whose official language is "English".
SQL: SELECT avg(T1.overall_score) FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id WHERE T3.name  =  "English"
Database: country_language
Question: What is the average overall score across countries with English as their official language?
SQL: SELECT avg(T1.overall_score) FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id WHERE T3.name  =  "English"
Database: country_language
Question: Show the three official languages that are most commonly spoken.
SQL: SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 3
Database: country_language
Question: What are the names of the three official languages spoken in the most countries?
SQL: SELECT T2.name FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 3
Database: country_language
Question: Show the official languages sorted in descending order by the average overall scores among countries speaking them.
SQL: SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id GROUP BY T3.id ORDER BY avg(T1.overall_score) DESC
Database: country_language
Question: What are the names of the official languages, sorted descending by the average overall scores across the countries that correspond to each?
SQL: SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id GROUP BY T3.id ORDER BY avg(T1.overall_score) DESC
Database: country_language
Question: Show the name of the country that has the greatest number of official languages.
SQL: SELECT T1.Name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
Database: country_language
Question: Which country has the greatest number of official languages?
SQL: SELECT T1.Name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
Database: country_language
Question: List the names of languages that are not the official language of any countries.
SQL: SELECT name FROM languages WHERE id NOT IN (SELECT language_id FROM official_languages)
Database: country_language
Question: What are the names of languages that are not the official language of any country?
SQL: SELECT name FROM languages WHERE id NOT IN (SELECT language_id FROM official_languages)
Database: country_language
Question: List the names of countries that do not have any official language.
SQL: SELECT name FROM countries WHERE id NOT IN (SELECT country_id FROM official_languages)
Database: country_language
Question: What are the names of countries that do not have an official language?
SQL: SELECT name FROM countries WHERE id NOT IN (SELECT country_id FROM official_languages)
Database: country_language
Question: Show the names of languages that are the official language for both countries with overall score greater than 95 and countries with overall score less than than 90.
SQL: SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id WHERE T1.overall_score  >  95 INTERSECT SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id WHERE T1.overall_score  <  90
Database: country_language
Question: What are the names of languages that are the official language not only for countries that have an overall score of above 95, but also for countries that have an overall score below 90?
SQL: SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id WHERE T1.overall_score  >  95 INTERSECT SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id WHERE T1.overall_score  <  90
Database: real_estate_rentals
Question: Which countries and cities are included in addresses?
SQL: SELECT country ,  town_city FROM Addresses;
Database: real_estate_rentals
Question: What are the countries and cities for each address?
SQL: SELECT country ,  town_city FROM Addresses;
Database: real_estate_rentals
Question: In which states are each of the the properties located?
SQL: SELECT DISTINCT T1.county_state_province FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id;
Database: real_estate_rentals
Question: Give the states or provinces corresponding to each property.
SQL: SELECT DISTINCT T1.county_state_province FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id;
Database: real_estate_rentals
Question: How is the feature rooftop described?
SQL: SELECT feature_description FROM Features WHERE feature_name  =  'rooftop';
Database: real_estate_rentals
Question: Return the description of the feature 'rooftop'.
SQL: SELECT feature_description FROM Features WHERE feature_name  =  'rooftop';
Database: real_estate_rentals
Question: What are the feature name and description of the most commonly seen feature across properties?
SQL: SELECT T1.feature_name ,  T1.feature_description FROM Features AS T1 JOIN Property_Features AS T2 ON T1.feature_id  =  T2.feature_id GROUP BY T1.feature_name ORDER BY count(*) DESC LIMIT 1;
Database: real_estate_rentals
Question: Give the feature name and description for the most common feature across all properties.
SQL: SELECT T1.feature_name ,  T1.feature_description FROM Features AS T1 JOIN Property_Features AS T2 ON T1.feature_id  =  T2.feature_id GROUP BY T1.feature_name ORDER BY count(*) DESC LIMIT 1;
Database: real_estate_rentals
Question: What is the minimum number of rooms in a property?
SQL: SELECT min(room_count) FROM Properties;
Database: real_estate_rentals
Question: What is the lowest room count across all the properties?
SQL: SELECT min(room_count) FROM Properties;
Database: real_estate_rentals
Question: How many properties have 1 parking lot or 1 garage?
SQL: SELECT count(*) FROM Properties WHERE parking_lots  =  1 OR garage_yn  =  1;
Database: real_estate_rentals
Question: Count the number of properties that have 1 parking lot or 1 garage.
SQL: SELECT count(*) FROM Properties WHERE parking_lots  =  1 OR garage_yn  =  1;
Database: real_estate_rentals
Question: For users whose description contain the string 'Mother', which age categories are they in?
SQL: SELECT T2.age_category_code FROM Ref_User_Categories AS T1 JOIN Users AS T2 ON T1.user_category_code  =  T2.user_category_code WHERE T1.User_category_description LIKE "%Mother";
Database: real_estate_rentals
Question: What are the age categories for users whose description contains the string Mother?
SQL: SELECT T2.age_category_code FROM Ref_User_Categories AS T1 JOIN Users AS T2 ON T1.user_category_code  =  T2.user_category_code WHERE T1.User_category_description LIKE "%Mother";
Database: real_estate_rentals
Question: What is the first name of the user who owns the greatest number of properties?
SQL: SELECT T1.first_name FROM Users AS T1 JOIN Properties AS T2 ON T2.owner_user_id  =  T1.User_id GROUP BY T1.User_id ORDER BY count(*) DESC LIMIT 1;
Database: real_estate_rentals
Question: Return the first name of the user who owns the most properties.
SQL: SELECT T1.first_name FROM Users AS T1 JOIN Properties AS T2 ON T2.owner_user_id  =  T1.User_id GROUP BY T1.User_id ORDER BY count(*) DESC LIMIT 1;
Database: real_estate_rentals
Question: List the average room count of the properties with gardens.
SQL: SELECT avg(T3.room_count) FROM Property_Features AS T1 JOIN Features AS T2 ON T1.feature_id  =  T2.feature_id JOIN Properties AS T3 ON T1.property_id  =  T3.property_id WHERE T2.feature_name  =  'garden';
Database: real_estate_rentals
Question: On average, how many rooms do properties with garden features have?
SQL: SELECT avg(T3.room_count) FROM Property_Features AS T1 JOIN Features AS T2 ON T1.feature_id  =  T2.feature_id JOIN Properties AS T3 ON T1.property_id  =  T3.property_id WHERE T2.feature_name  =  'garden';
Database: real_estate_rentals
Question: In which cities are there any properties equipped with a swimming pool?
SQL: SELECT T2.town_city FROM Properties AS T1 JOIN Addresses AS T2 ON T1.property_address_id  =  T2.address_id JOIN Property_Features AS T3 ON T1.property_id  =  T3.property_id JOIN Features AS T4 ON T4.feature_id  =  T3.feature_id WHERE T4.feature_name  =  'swimming pool';
Database: real_estate_rentals
Question: Return the cities in which there exist properties that have swimming pools.
SQL: SELECT T2.town_city FROM Properties AS T1 JOIN Addresses AS T2 ON T1.property_address_id  =  T2.address_id JOIN Property_Features AS T3 ON T1.property_id  =  T3.property_id JOIN Features AS T4 ON T4.feature_id  =  T3.feature_id WHERE T4.feature_name  =  'swimming pool';
Database: real_estate_rentals
Question: Which property had the lowest price requested by the vendor? List the id and the price.
SQL: SELECT property_id ,  vendor_requested_price FROM Properties ORDER BY vendor_requested_price LIMIT 1;
Database: real_estate_rentals
Question: What is the id of the property that had the lowest requested price from the vendor, and what was that price?
SQL: SELECT property_id ,  vendor_requested_price FROM Properties ORDER BY vendor_requested_price LIMIT 1;
Database: real_estate_rentals
Question: On average, how many rooms does a property have?
SQL: SELECT avg(room_count) FROM Properties;
Database: real_estate_rentals
Question: What is the average number of rooms in a property?
SQL: SELECT avg(room_count) FROM Properties;
Database: real_estate_rentals
Question: How many kinds of room sizes are listed?
SQL: SELECT count(DISTINCT room_size) FROM Rooms;
Database: real_estate_rentals
Question: Return the number of different room sizes.
SQL: SELECT count(DISTINCT room_size) FROM Rooms;
Database: real_estate_rentals
Question: What are the ids of users who have searched at least twice, and what did they search?
SQL: SELECT search_seq ,  user_id FROM User_Searches GROUP BY user_id HAVING count(*) >= 2;
Database: real_estate_rentals
Question: Return the ids of users who have performed two or more searches, as well as their search sequence.
SQL: SELECT search_seq ,  user_id FROM User_Searches GROUP BY user_id HAVING count(*) >= 2;
Database: real_estate_rentals
Question: When was the time of the latest search by a user?
SQL: SELECT max(search_datetime) FROM User_Searches;
Database: real_estate_rentals
Question: What was the time of the most recent search?
SQL: SELECT max(search_datetime) FROM User_Searches;
Database: real_estate_rentals
Question: What are all the user searches time and content? Sort the result descending by content.
SQL: SELECT search_datetime ,  search_string FROM User_Searches ORDER BY search_string DESC;
Database: real_estate_rentals
Question: Return the search strings and corresonding time stamps for all user searches, sorted by search string descending.
SQL: SELECT search_datetime ,  search_string FROM User_Searches ORDER BY search_string DESC;
Database: real_estate_rentals
Question: What are the zip codes of properties which do not belong to users who own at most 2 properties?
SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id WHERE T2.owner_user_id NOT IN ( SELECT owner_user_id FROM Properties GROUP BY owner_user_id HAVING count(*)  <=  2 );
Database: real_estate_rentals
Question: Return the zip codes for properties not belonging to users who own two or fewer properties.
SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id WHERE T2.owner_user_id NOT IN ( SELECT owner_user_id FROM Properties GROUP BY owner_user_id HAVING count(*)  <=  2 );
Database: real_estate_rentals
Question: What are the users making only one search? List both category and user id.
SQL: SELECT T1.user_category_code ,  T1.user_id FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id GROUP BY T1.user_id HAVING count(*)  =  1;
Database: real_estate_rentals
Question: What are the ids of users who have only made one search, and what are their category codes?
SQL: SELECT T1.user_category_code ,  T1.user_id FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id GROUP BY T1.user_id HAVING count(*)  =  1;
Database: real_estate_rentals
Question: What is the age range category of the user who made the first search?
SQL: SELECT T1.age_category_code FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id ORDER BY T2.search_datetime LIMIT 1;
Database: real_estate_rentals
Question: Return the age category for the user who made the earliest search.
SQL: SELECT T1.age_category_code FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id ORDER BY T2.search_datetime LIMIT 1;
Database: real_estate_rentals
Question: Find the login names of all senior citizen users ordered by their first names.
SQL: SELECT login_name FROM Users WHERE user_category_code  =  'Senior Citizen' ORDER BY first_name
Database: real_estate_rentals
Question: What are the login names of all senior citizens, sorted by first name?
SQL: SELECT login_name FROM Users WHERE user_category_code  =  'Senior Citizen' ORDER BY first_name
Database: real_estate_rentals
Question: How many searches do buyers make in total?
SQL: SELECT count(*) FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id WHERE T1.is_buyer  =  1;
Database: real_estate_rentals
Question: Count the number of searches made by buyers.
SQL: SELECT count(*) FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id WHERE T1.is_buyer  =  1;
Database: real_estate_rentals
Question: When did the user with login name ratione register?
SQL: SELECT date_registered FROM Users WHERE login_name  =  'ratione';
Database: real_estate_rentals
Question: What was the registration date for the user whose login name is ratione?
SQL: SELECT date_registered FROM Users WHERE login_name  =  'ratione';
Database: real_estate_rentals
Question: List the first name, middle name and last name, and log in name of all the seller users, whose seller value is 1.
SQL: SELECT first_name ,  middle_name ,  last_name ,  login_name FROM Users WHERE is_seller  =  1;
Database: real_estate_rentals
Question: What are the first, middle, last, and login names for all users who are sellers?
SQL: SELECT first_name ,  middle_name ,  last_name ,  login_name FROM Users WHERE is_seller  =  1;
Database: real_estate_rentals
Question: Where do the Senior Citizens live? List building, street, and the city.
SQL: SELECT T1.line_1_number_building ,  T1.line_2_number_street ,  T1.town_city FROM Addresses AS T1 JOIN Users AS T2 ON T1.address_id  =  T2.user_address_id WHERE T2.user_category_code  =  'Senior Citizen';
Database: real_estate_rentals
Question: What are the buildings, streets, and cities corresponding to the addresses of senior citizens?
SQL: SELECT T1.line_1_number_building ,  T1.line_2_number_street ,  T1.town_city FROM Addresses AS T1 JOIN Users AS T2 ON T1.address_id  =  T2.user_address_id WHERE T2.user_category_code  =  'Senior Citizen';
Database: real_estate_rentals
Question: How many properties are there with at least 2 features?
SQL: SELECT count(*) FROM Properties GROUP BY property_id HAVING count(*)  >= 2;
Database: real_estate_rentals
Question: Count the number of properties with at least two features.
SQL: SELECT count(*) FROM Properties GROUP BY property_id HAVING count(*)  >= 2;
Database: real_estate_rentals
Question: How many photos does each property have?
SQL: SELECT count(*) ,  property_id FROM Property_Photos GROUP BY property_id;
Database: real_estate_rentals
Question: Count the number of property photos each property has by id.
SQL: SELECT count(*) ,  property_id FROM Property_Photos GROUP BY property_id;
Database: real_estate_rentals
Question: How many photos does each owner has of his or her properties? List user id and number of photos.
SQL: SELECT T1.owner_user_id ,  count(*) FROM Properties AS T1 JOIN Property_Photos AS T2 ON T1.property_id  =  T2.property_id GROUP BY T1.owner_user_id;
Database: real_estate_rentals
Question: What are the user ids of property owners who have property photos, and how many do each of them have?
SQL: SELECT T1.owner_user_id ,  count(*) FROM Properties AS T1 JOIN Property_Photos AS T2 ON T1.property_id  =  T2.property_id GROUP BY T1.owner_user_id;
Database: real_estate_rentals
Question: What is the total max price of the properties owned by single mothers or students?
SQL: SELECT sum(T1.price_max) FROM Properties AS T1 JOIN Users AS T2 ON T1.owner_user_id  =  T2.user_id WHERE T2.user_category_code  =  'Single Mother' OR T2.user_category_code  =  'Student';
Database: real_estate_rentals
Question: Give the total max price corresponding to any properties owned by single mothers or students.
SQL: SELECT sum(T1.price_max) FROM Properties AS T1 JOIN Users AS T2 ON T1.owner_user_id  =  T2.user_id WHERE T2.user_category_code  =  'Single Mother' OR T2.user_category_code  =  'Student';
Database: real_estate_rentals
Question: What are the date stamps and property names for each item of property history, ordered by date stamp?
SQL: SELECT T1.datestamp ,  T2.property_name FROM User_Property_History AS T1 JOIN Properties AS T2 ON T1.property_id  =  T2.property_id ORDER BY datestamp;
Database: real_estate_rentals
Question: Return the date stamp and property name for each property history event, sorted by date stamp.
SQL: SELECT T1.datestamp ,  T2.property_name FROM User_Property_History AS T1 JOIN Properties AS T2 ON T1.property_id  =  T2.property_id ORDER BY datestamp;
Database: real_estate_rentals
Question: What is the description of the most common property type? List the description and code.
SQL: SELECT T1.property_type_description ,  T1.property_type_code FROM Ref_Property_Types AS T1 JOIN Properties AS T2 ON T1.property_type_code  =  T2.property_type_code GROUP BY T1.property_type_code ORDER BY count(*) DESC LIMIT 1;
Database: real_estate_rentals
Question: What is the most common property type, and what is its description.
SQL: SELECT T1.property_type_description ,  T1.property_type_code FROM Ref_Property_Types AS T1 JOIN Properties AS T2 ON T1.property_type_code  =  T2.property_type_code GROUP BY T1.property_type_code ORDER BY count(*) DESC LIMIT 1;
Database: real_estate_rentals
Question: What is the detailed description of the age category code 'Over 60'?
SQL: SELECT age_category_description FROM Ref_Age_Categories WHERE age_category_code  =  'Over 60';
Database: real_estate_rentals
Question: Give the category description of the age category 'Over 60'.
SQL: SELECT age_category_description FROM Ref_Age_Categories WHERE age_category_code  =  'Over 60';
Database: real_estate_rentals
Question: What are the different room sizes, and how many of each are there?
SQL: SELECT room_size ,  count(*) FROM Rooms GROUP BY room_size
Database: real_estate_rentals
Question: Return the number of rooms with each different room size.
SQL: SELECT room_size ,  count(*) FROM Rooms GROUP BY room_size
Database: real_estate_rentals
Question: In which country does the user with first name Robbie live?
SQL: SELECT T1.country FROM Addresses AS T1 JOIN Users AS T2 ON T1.address_id  =  T2.user_address_id WHERE T2.first_name  =  'Robbie';
Database: real_estate_rentals
Question: Return the country in which the user with first name Robbie lives.
SQL: SELECT T1.country FROM Addresses AS T1 JOIN Users AS T2 ON T1.address_id  =  T2.user_address_id WHERE T2.first_name  =  'Robbie';
Database: real_estate_rentals
Question: What are the first, middle and last names of users who own the property they live in?
SQL: SELECT first_name ,  middle_name ,  last_name FROM Properties AS T1 JOIN Users AS T2 ON T1.owner_user_id  =  T2.user_id WHERE T1.property_address_id  =  T2.user_address_id;
Database: real_estate_rentals
Question: Return the full names of users who live in properties that they own.
SQL: SELECT first_name ,  middle_name ,  last_name FROM Properties AS T1 JOIN Users AS T2 ON T1.owner_user_id  =  T2.user_id WHERE T1.property_address_id  =  T2.user_address_id;
Database: real_estate_rentals
Question: List the search content of the users who do not own a single property.
SQL: SELECT search_string FROM User_Searches EXCEPT SELECT T1.search_string FROM User_Searches AS T1 JOIN Properties AS T2 ON T1.user_id  =  T2.owner_user_id;
Database: real_estate_rentals
Question: What search strings were entered by users who do not own any properties?
SQL: SELECT search_string FROM User_Searches EXCEPT SELECT T1.search_string FROM User_Searches AS T1 JOIN Properties AS T2 ON T1.user_id  =  T2.owner_user_id;
Database: real_estate_rentals
Question: List the last names and ids of users who have at least 2 properties and searched at most twice.
SQL: SELECT T1.last_name ,  T1.user_id FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id GROUP BY T1.user_id HAVING count(*)  <=  2 INTERSECT SELECT T3.last_name ,  T3.user_id FROM Users AS T3 JOIN Properties AS T4 ON T3.user_id  =  T4.owner_user_id GROUP BY T3.user_id HAVING count(*)  >=  2;
Database: real_estate_rentals
Question: What are the last names and ids of users who have searched two or fewer times, and own two or more properties?
SQL: SELECT T1.last_name ,  T1.user_id FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id GROUP BY T1.user_id HAVING count(*)  <=  2 INTERSECT SELECT T3.last_name ,  T3.user_id FROM Users AS T3 JOIN Properties AS T4 ON T3.user_id  =  T4.owner_user_id GROUP BY T3.user_id HAVING count(*)  >=  2;
Database: bike_racing
Question: How many bikes are heavier than 780 grams?
SQL: SELECT count(*) FROM bike WHERE weight  >  780
Database: bike_racing
Question: List the product names and weights of the bikes in ascending order of price.
SQL: SELECT product_name ,  weight FROM bike ORDER BY price ASC
Database: bike_racing
Question: List the heat, name, and nation for all the cyclists.
SQL: SELECT heat ,  name ,  nation FROM cyclist
Database: bike_racing
Question: What are the maximum and minimum weight of all bikes?
SQL: SELECT max(weight) ,  min(weight) FROM bike
Database: bike_racing
Question: What is the average price of the bikes made of material 'Carbon CC'?
SQL: SELECT avg(price) FROM bike WHERE material  =  'Carbon CC'
Database: bike_racing
Question: What are the name and result of the cyclists not from 'Russia' ?
SQL: SELECT name ,  RESULT FROM cyclist WHERE nation != 'Russia'
Database: bike_racing
Question: What are the distinct ids and product names of the bikes that are purchased after year 2015?
SQL: SELECT DISTINCT T1.id ,  T1.product_name FROM bike AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.bike_id WHERE T2.purchase_year  >  2015
Database: bike_racing
Question: What are the ids and names of racing bikes that are purchased by at least 4 cyclists?
SQL: SELECT T1.id ,  T1.product_name FROM bike AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.bike_id GROUP BY T1.id HAVING count(*)  >=  4
Database: bike_racing
Question: What are the id and name of the cyclist who owns the most bikes?
SQL: SELECT T1.id ,  T1.name FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.cyclist_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Database: bike_racing
Question: What are the distinct product names of bikes owned by cyclists from 'Russia' or cyclists from 'Great Britain'?
SQL: SELECT DISTINCT T3.product_name FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.cyclist_id JOIN bike AS T3 ON T2.bike_id  =  T3.id WHERE T1.nation  =  'Russia' OR T1.nation  =  'Great Britain'
Database: bike_racing
Question: How many different levels of heat are there for the cyclists?
SQL: SELECT count(DISTINCT heat) FROM cyclist
Database: bike_racing
Question: How many cyclists did not purchase any bike after year 2015?
SQL: SELECT count(*) FROM cyclist WHERE id NOT IN ( SELECT cyclist_id FROM cyclists_own_bikes WHERE purchase_year  >  2015 )
Database: bike_racing
Question: What are the names of distinct racing bikes that are purchased by the cyclists with better results than '4:21.558' ?
SQL: SELECT DISTINCT T3.product_name FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.cyclist_id JOIN bike AS T3 ON T2.bike_id  =  T3.id WHERE T1.result  <  '4:21.558'
Database: bike_racing
Question: List the name and price of the bike that is owned by both the cyclists named 'Bradley Wiggins' and the cyclist named 'Antonio Tauler'.
SQL: SELECT T3.product_name ,  T3.price FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.cyclist_id JOIN bike AS T3 ON T2.bike_id  =  T3.id WHERE T1.name  =  'Bradley Wiggins' INTERSECT SELECT T3.product_name ,  T3.price FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.cyclist_id JOIN bike AS T3 ON T2.bike_id  =  T3.id WHERE T1.name  =  'Antonio Tauler'
Database: bike_racing
Question: Show the name, nation and result for the cyclists who did not purchase any racing bike.
SQL: SELECT name ,  nation ,  RESULT FROM cyclist EXCEPT SELECT T1.name ,  T1.nation ,  T1.result FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id  =  T2.cyclist_id
Database: bike_racing
Question: What are the names of the bikes that have substring 'fiber' in their material?
SQL: SELECT product_name FROM bike WHERE material LIKE "%fiber%"
Database: bike_racing
Question: How many bikes does each cyclist own? Order by cyclist id.
SQL: SELECT cyclist_id ,  count(*) FROM cyclists_own_bikes GROUP BY cyclist_id ORDER BY cyclist_id
Database: bakery_1
Question: What is the most expensive cake and its flavor?
SQL: SELECT id ,  flavor FROM goods WHERE food  =  "Cake" ORDER BY price DESC LIMIT 1
Database: bakery_1
Question: Give the id and flavor of the most expensive cake.
SQL: SELECT id ,  flavor FROM goods WHERE food  =  "Cake" ORDER BY price DESC LIMIT 1
Database: bakery_1
Question: What is the cheapest cookie and its flavor?
SQL: SELECT id ,  flavor FROM goods WHERE food  =  "Cookie" ORDER BY price LIMIT 1
Database: bakery_1
Question: What is the id and flavor of the cheapest cookie?
SQL: SELECT id ,  flavor FROM goods WHERE food  =  "Cookie" ORDER BY price LIMIT 1
Database: bakery_1
Question: Find the ids of goods that have apple flavor.
SQL: SELECT id FROM goods WHERE flavor  =  "Apple"
Database: bakery_1
Question: What are the ids with apple flavor?
SQL: SELECT id FROM goods WHERE flavor  =  "Apple"
Database: bakery_1
Question: What are the ids of goods that cost less than 3 dollars?
SQL: SELECT id FROM goods WHERE price  <  3
Database: bakery_1
Question: Give the ids of goods that cost less than 3 dollars.
SQL: SELECT id FROM goods WHERE price  <  3
Database: bakery_1
Question: List the distinct ids of all customers who bought a cake with lemon flavor?
SQL: SELECT DISTINCT T3.CustomerId FROM goods AS T1 JOIN items AS T2 ON T1.Id  =  T2.Item JOIN receipts AS T3 ON T2.Receipt  =  T3.ReceiptNumber WHERE T1.Flavor  =  "Lemon" AND T1.Food  =  "Cake"
Database: bakery_1
Question: What are the distinct ids of customers who bought lemon flavored cake?
SQL: SELECT DISTINCT T3.CustomerId FROM goods AS T1 JOIN items AS T2 ON T1.Id  =  T2.Item JOIN receipts AS T3 ON T2.Receipt  =  T3.ReceiptNumber WHERE T1.Flavor  =  "Lemon" AND T1.Food  =  "Cake"
Database: bakery_1
Question: For each type of food, tell me how many customers have ever bought it.
SQL: SELECT T1.food ,  count(DISTINCT T3.CustomerId) FROM goods AS T1 JOIN items AS T2 ON T1.Id  =  T2.Item JOIN receipts AS T3 ON T2.Receipt  =  T3.ReceiptNumber GROUP BY T1.food