Chinastark/bird_dataset huggingface dataset:
Database: world_development_indicators
Note: the Republic of Albania refers to longname = 'Republic of Albania'; in the year 1960 refers to year = '1960';
Question: What are the indicator codes for the Republic of Albania in the year 1960?
SQL: SELECT DISTINCT indicators.indicatorcode FROM indicators INNER JOIN country ON indicators.countrycode = country.countrycode WHERE indicators.year = 1960 AND country.longname = 'Republic of Albania'
Database: world_development_indicators
Note: cereal production of 6140000 metric tons refers value where indicatorname = 'Cereal production (metric tons)'> 6140000; the year 1966 refers to year = '1966';
Question: What is the lending category of the country with a cereal production of 6140000 metric tons for the year 1966?
SQL: SELECT country.lendingcategory FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE indicators.indicatorname = 'Cereal production (metric tons)' AND indicators.value = 6140000 AND indicators.year = 1966
Database: world_development_indicators
Note: the highest population in largest city refers to max(value where indicatorname = 'Population in largest city'); for 19 consecutive years starting from 1960 refers to year BETWEEN'1960' and '1979';
Question: Which country has the highest population in largest city for 19 consecutive years starting from 1960? Indicate the region to which the country is located.
SQL: SELECT country.countrycode, country.region FROM indicators INNER JOIN country ON indicators.countrycode = country.countrycode WHERE indicators.indicatorname = 'Population in largest city' AND indicators.year >= 1960 AND indicators.year < 1980 ORDER BY country.region DESC LIMIT 1
Database: world_development_indicators
Note: from 1975 to 1980 refers to year between 1975 and 1980; the total amount CO2 emmission in kiloton of the the world refers to sum(value where indicatorname like 'CO2%'); the world recorded its highest CO2 emmissions refers to max(value where indicatorname like 'CO2%');
Question: From 1975 to 1980, how much is the total amount CO2 emmission in kiloton of the the world? Indicate which year the world recorded its highest CO2 emmissions.
SQL: SELECT sum(indicators.value), indicators.year FROM indicators INNER JOIN country ON indicators.countrycode = country.countrycode WHERE indicators.indicatorname = 'CO2 emissions (kt)' AND indicators.year >= 1975 AND indicators.year < 1981 AND indicators.countrycode = 'WLD' AND country.specialnotes = 'World aggregate.'
Database: world_development_indicators
Note: the smallest land area in square kilometers refers to min(value where indicatorname like 'Land area (sq. km)'); for 19 consecutive years starting from year 1961 refers to year between 1961 and 1979;
Question: Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961? Indicate how much is its land area in square kilometers in those years and the income group of the country.
SQL: SELECT indicators.countryname, sum(indicators.value) area, country.incomegroup FROM indicators INNER JOIN country ON indicators.countrycode = country.countrycode WHERE indicators.indicatorname = 'Land area (sq. km)' AND indicators.year >= 1961 AND indicators.year < 1980 GROUP BY indicators.countrycode ORDER BY sum(indicators.value) ASC LIMIT 1
Database: world_development_indicators
Note: average number refers to avg(value); passengers carried via air transport per year refers to value where indicatorname = 'Air transport, passengers carried'; by Bulgaria refers to countryname = 'Bulgaria'; between 1970 to 1980 refers to year between 1970 and 1980;
Question: What is the average number of passengers carried via air transport per year by Bulgaria between 1970 to 1980? Indicate the country's system of trade.
SQL: SELECT avg(indicators.value), country.systemoftrade FROM indicators INNER JOIN country ON indicators.countrycode = country.countrycode WHERE indicators.indicatorname = 'Air transport, passengers carried' AND indicators.year >= 1970 AND indicators.year < 1981 AND indicators.countryname = 'Bulgaria'
Database: world_development_indicators
Note: in Angola refers to shortname = 'Angola'; when refers to pppsurveyyear;
Question: What's the lastest household survey in Angola and when did it take place?
SQL: SELECT latesthouseholdsurvey, pppsurveyyear FROM country WHERE shortname = 'Angola'
Database: world_development_indicators
Note: has completed the vital registration refers to vitalregistrationcomplete = 'Yes';
Question: How many countries in the North America Region has completed the vital registration?
SQL: SELECT count(countrycode) FROM country WHERE vitalregistrationcomplete = 'Yes' AND region = 'North America'
Database: world_development_indicators
Note: indicator Adolescent fertility rate refers to indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)';
Question: In which years does the country whose Alpha2Code is 1A have a result of the indicator Adolescent fertility rate?
SQL: SELECT indicators.year FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'
Database: world_development_indicators
Note: long name refers to countryname; got 3000000 on the indicator Arms exports refers to value where indicatorname = 'Arms exports (SIPRI trend indicator values)' = 3000000; in 1960 refers to year = 1960;
Question: What's the long name of the country that got 3000000 on the indicator Arms exports in 1960?
SQL: SELECT country.longname FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE indicators.indicatorname = 'Arms exports (SIPRI trend indicator values)' AND indicators.year = 1960 AND indicators.value = 3000000
Database: world_development_indicators
Note: in 1960 refers to year = '1960';
Question: Please list the Alpha2Codes of all the countries that have an indicator on Rural population in 1960.
SQL: SELECT country.alpha2code FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE indicators.indicatorname = 'Rural population' AND indicators.year = 1960
Database: world_development_indicators
Note: indicator for Adolescent fertility rate is the highest refers to max(value where indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'); in 1960 refers to year = '1960';
Question: Which country's indicator for Adolescent fertility rate is the highest in 1960, please give its special notes.
SQL: SELECT DISTINCT country.countrycode, country.specialnotes FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE indicators.value = ( SELECT value FROM indicators WHERE indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND YEAR = 1960 ORDER BY value DESC LIMIT 1 )
Database: world_development_indicators
Note: by how much = subtract(sum(value where year = 1961), sum(value where year = 1960)); indicator on Adolescent fertility rate refers to indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)%';
Question: By how much did the indicator on Adolescent fertility rate increase from 1960 to 1961 in the country whose Alpha2Code is 1A?
SQL: SELECT ( SELECT indicators.value FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND indicators.year = 1961 ) - ( SELECT indicators.value FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND indicators.year = 1960 ) diff
Database: world_development_indicators
Note: note refers to description; for Australia refers to shortname = 'Australia'; indicator SP.ADO.TFRT refers to seriescode = 'SP.ADO.TFRT';
Question: What is the note for Australia on the indicator SP.ADO.TFRT?
SQL: SELECT countrynotes.description FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.seriescode = 'SP.ADO.TFRT' AND country.shortname = 'Australia'
Database: world_development_indicators
Note: note refers to description; for Aruba refers to shortname = 'Aruba';
Question: Please list the notes for Aruba on the indicators under the topic of Environment: Energy production & use.
SQL: SELECT countrynotes.description FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode INNER JOIN series ON countrynotes.seriescode = series.seriescode WHERE country.shortname = 'Aruba' AND series.topic = 'Environment: Energy production & use'
Database: world_development_indicators
Note: indicator BX.KLT.DINV.CD.WD refers to seriescode = 'BX.KLT.DINV.CD.WD';
Question: Which countries have notes on the indicator BX.KLT.DINV.CD.WD?
SQL: SELECT country.shortname FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode INNER JOIN series ON countrynotes.seriescode = series.seriescode WHERE series.seriescode = 'BX.KLT.DINV.CD.WD'
Database: world_development_indicators
Note: indicator Inflation, consumer prices refers to indicatorname = 'Inflation, consumer prices (annual %)';
Question: For the country that has notes on the indicator Inflation, consumer prices, in which region is it in?
SQL: SELECT country.region FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode INNER JOIN series ON countrynotes.seriescode = series.seriescode WHERE series.indicatorname = 'Inflation, consumer prices (annual %)'
Database: world_development_indicators
Note: indicator Stocks traded, turnover ratio of domestic shares refers to indicatorname = 'Stocks traded, turnover ratio of domestic shares (%)';
Question: How many countries have notes on the indicator Stocks traded, turnover ratio of domestic shares?
SQL: SELECT count(countrynotes.countrycode)  FROM countrynotes INNER JOIN series ON countrynotes.seriescode = series.seriescode WHERE series.indicatorname = 'Stocks traded, turnover ratio of domestic shares (%)'
Database: world_development_indicators
Note: in 1960 refers to year = 1960; for the Arab World refers to countryname = 'Arab World';
Question: What's the agregation method for the indicator whose value is 133 in 1960 for the Arab World?
SQL: SELECT series.aggregationmethod FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname INNER JOIN country ON indicators.countrycode = country.countrycode WHERE country.shortname = 'Arab World' AND indicators.value = 133 AND indicators.year = 1960
Database: world_development_indicators
Note: in 1960 refers to year = 1960; for the Arab World refers to countryname = 'Arab World';
Question: What's the value of the indicator whose long definition is "Adolescent fertility rate is the number of births per 1,000 women ages 15-19." for the Arab World in 1960?
SQL: SELECT indicators.value FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname INNER JOIN country ON indicators.countrycode = country.countrycode WHERE series.longdefinition = 'Adolescent fertility rate is the number of births per 1,000 women ages 15-19.' AND country.shortname = 'Arab World' AND indicators.year = 1960
Database: world_development_indicators
Note: the percentage of increase from 1960 to 1961 = divide(subtract(sum(value where year = 1961), sum(value where year = 1960)), sum(value where year = 1960)) *100%; indicator on Adolescent fertility rate refers to indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)%';
Question: What is the percentage of increase of the indicator on Adolescent fertility rate from 1960 to 1961 in the country whose Alpha2Code is 1A?
SQL: SELECT (( SELECT indicators.value FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND indicators.year = 1961 ) - ( SELECT indicators.value FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND indicators.year = 1960 )) * 1.0 / ( SELECT sum(indicators.value) FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND indicators.year = 1960 )
Database: world_development_indicators
Note: average value = AVG(value) where indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)';
Question: What is the average value of Adolescent fertility rate in the country whose Alpha2Code is 1A?
SQL: SELECT cast(sum(indicators.value) AS REAL) * 100 / count(indicators.year) FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.alpha2code = '1A' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'
Database: movielens
Question: List the different director IDs of the movies whose user rating is more than 4.
SQL: SELECT DISTINCT movies2directors.directorid FROM u2base INNER JOIN movies2directors ON u2base.movieid = movies2directors.movieid WHERE u2base.rating > 4
Database: movielens
Note: Male users mean that u_gender = 'M';
Question: Among the users who gave a rating of 5, how many of them are male?
SQL: SELECT count(u2base.userid) FROM u2base INNER JOIN users ON u2base.userid = users.userid WHERE u2base.rating = 5 AND users.u_gender = 'M'
Database: movielens
Question: List the genres of the movies which actor id 851 is the star.
SQL: SELECT movies2directors.genre FROM movies2actors INNER JOIN movies2directors ON movies2actors.movieid = movies2directors.movieid INNER JOIN actors ON movies2actors.actorid = actors.actorid WHERE actors.actorid = 851
Database: movielens
Question: How many movies from the USA which user rating is less than 3?
SQL: SELECT count(u2base.movieid) FROM u2base INNER JOIN movies ON u2base.movieid = movies.movieid WHERE movies.country = 'USA' AND u2base.rating < 3
Database: movielens
Note: France a one country;
Question: Among the movies from France, how many of them are drama?
SQL: SELECT count(movies2directors.movieid) FROM movies2directors INNER JOIN movies ON movies2directors.movieid = movies.movieid WHERE movies.country = 'France' AND movies2directors.genre = 'drama'
Database: movielens
Question: What is the average occupation of users whose ratings are not more than 2 ?
SQL: SELECT avg(users.occupation) FROM u2base INNER JOIN users ON u2base.userid = users.userid WHERE u2base.rating < 2
Database: movielens
Note: USA is a country;
Question: List the top 10 USA movies, by descending order, from the highest to the lowest, the user rating.
SQL: SELECT u2base.movieid FROM u2base INNER JOIN movies ON u2base.movieid = movies.movieid WHERE movies.country = 'USA' GROUP BY u2base.movieid ORDER BY avg(u2base.rating) DESC LIMIT 10
Database: movielens
Note: USA is a country;
Question: What is the average number of casts of movies that are from the USA?
SQL: SELECT avg(movies2actors.cast_num) FROM movies INNER JOIN movies2actors ON movies.movieid = movies2actors.movieid WHERE movies.country = 'USA'
Database: movielens
Note: not in English can be represented by isenglish = 'F';
Question: List the top 5 movies from other countries which to language is not in English.
SQL: SELECT DISTINCT u2base.movieid FROM u2base INNER JOIN movies ON u2base.movieid = movies.movieid WHERE movies.country = 'other' AND movies.isenglish = 'F' LIMIT 5
Database: movielens
Question: Among the best actors, how many of them got a rating of 5 to the movies they starred?
SQL: SELECT count(actors.actorid) FROM actors INNER JOIN movies2actors ON actors.actorid = movies2actors.actorid INNER JOIN u2base ON movies2actors.movieid = u2base.movieid WHERE actors.a_quality = 5 AND u2base.rating = 5
Database: movielens
Note: France is a country; year = 4 represents the newest date.;
Question: What is the average rating of the newest movies from France?
SQL: SELECT avg(u2base.rating) FROM u2base INNER JOIN movies ON u2base.movieid = movies.movieid WHERE movies.country = 'france' AND movies.year = 4
Database: movielens
Note: UK is a country;
Question: Among the most rated UK movies, how many of them has running time of less than 2?
SQL: SELECT count(u2base.movieid) FROM u2base INNER JOIN movies ON u2base.movieid = movies.movieid WHERE movies.country = 'UK' AND movies.runningtime < 2 AND u2base.rating = 5
Database: movielens
Note: Male users mean that u_gender = 'M'; France is a country;
Question: List the id of male users who gave ratings of less than 3 to French movies with running time of 2.
SQL: SELECT u2base.userid FROM u2base INNER JOIN movies ON u2base.movieid = movies.movieid INNER JOIN users ON u2base.userid = users.userid WHERE movies.country = 'France' AND movies.runningtime = 2 AND u2base.rating < 3 AND users.u_gender = 'M'
Database: movielens
Note: Worst actresses means a_quality is the least; The least a_quality is 0;
Question: Among the worst actresses, how many of them got a rating of more than 3 to the movies they starred?
SQL: SELECT count(u2base.userid) FROM u2base INNER JOIN movies2actors ON u2base.movieid = movies2actors.movieid INNER JOIN actors ON movies2actors.actorid = actors.actorid INNER JOIN users ON u2base.userid = users.userid WHERE actors.a_quality = 0 AND u2base.rating > 3 AND users.u_gender = 'F'
Database: movielens
Note: The audience and users are the same meaning;
Question: What is the ID of audiences that gave the most rating of 5?
SQL: SELECT userid FROM u2base WHERE rating = 5 GROUP BY userid ORDER BY count(movieid) DESC LIMIT 1
Database: movielens
Question: What are the ID of actors that had worked together with director 22397? What was the genre of that movie?
SQL: SELECT movies2actors.actorid, movies2directors.genre FROM movies INNER JOIN movies2actors ON movies.movieid = movies2actors.movieid INNER JOIN actors ON movies2actors.actorid = actors.actorid INNER JOIN movies2directors ON movies.movieid = movies2directors.movieid WHERE movies2directors.directorid = 22397
Database: movielens
Question: Please list down the ID of actors and directors in action movies.
SQL: SELECT movies2actors.actorid, movies2directors.directorid FROM movies2directors INNER JOIN movies2actors ON movies2directors.movieid = movies2actors.movieid WHERE movies2directors.genre = 'Action'
Database: movielens
Note: Female actors mean that a_gender = 'F';
Question: How many female actors acted in the movies of year 4?
SQL: SELECT count(movies2actors.actorid) FROM movies INNER JOIN movies2actors ON movies.movieid = movies2actors.movieid INNER JOIN actors ON movies2actors.actorid = actors.actorid WHERE actors.a_gender = 'F' AND movies.year = 4
Database: movielens
Note: English movies refers to isenglish = 'T'; USA is a country;
Question: What are the ID of actors with quality rating of 3 acted in English USA movies?
SQL: SELECT movies2actors.actorid FROM movies INNER JOIN movies2actors ON movies.movieid = movies2actors.movieid INNER JOIN actors ON movies2actors.actorid = actors.actorid WHERE actors.a_quality = 3 AND movies.country = 'USA' AND movies.isenglish = 'T'
Database: movielens
Question: List down the ID of movies with running time of 3 and average revenue of 1?
SQL: SELECT movies.movieid FROM movies INNER JOIN movies2directors ON movies.movieid = movies2directors.movieid INNER JOIN directors ON movies2directors.directorid = directors.directorid WHERE movies.runningtime = 3 AND directors.avg_revenue = 1
Database: movielens
Note: UK is a country;
Question: UK produced what genre of movies?
SQL: SELECT movies2directors.genre FROM movies INNER JOIN movies2directors ON movies.movieid = movies2directors.movieid WHERE movies.country = 'UK'
Database: movielens
Note: The audience and users are the same meaning;
Question: What is the favourite movie genre for audiences of age 18?
SQL: SELECT movies2directors.genre FROM movies2directors INNER JOIN u2base ON movies2directors.movieid = u2base.movieid INNER JOIN users ON u2base.userid = users.userid WHERE users.age = 18 GROUP BY movies2directors.genre ORDER BY count(movies2directors.movieid) DESC LIMIT 1
Database: movielens
Note: The audience and users are the same meaning;
Question: What is the ID of actors that acted in the movies most viewed by audience with occupation 5?
SQL: SELECT movies2actors.actorid FROM users INNER JOIN u2base ON users.userid = u2base.userid INNER JOIN movies2actors ON u2base.movieid = movies2actors.movieid WHERE users.occupation = 5 GROUP BY u2base.movieid ORDER BY count(users.userid) DESC LIMIT 1
Database: movielens
Note: The audience and users are the same meaning;
Question: Movies with rating 3 are viewed by audiences in which distinct age group?
SQL: SELECT DISTINCT users.age FROM u2base INNER JOIN users ON u2base.userid = users.userid WHERE u2base.rating = 3
Database: movielens
Question: Action movies are mostly directed by directors of which country?
SQL: SELECT movies.country FROM movies2directors INNER JOIN directors ON movies2directors.directorid = directors.directorid INNER JOIN movies ON movies2directors.movieid = movies.movieid WHERE movies2directors.genre = 'Action' GROUP BY movies.country ORDER BY count(movies.country) DESC LIMIT 1
Database: movielens
Question: Please list down ID of movies acted by top 5 actors based on actor rating.
SQL: SELECT movies2actors.movieid FROM actors INNER JOIN movies2actors ON actors.actorid = movies2actors.actorid GROUP BY movies2actors.actorid ORDER BY avg(actors.a_quality) DESC LIMIT 5
Database: movielens
Note: not English refers to isenglish = 'F'; UK is a country;
Question: List down 5 non English adventure movies from UK?
SQL: SELECT movies2directors.movieid FROM movies2directors INNER JOIN movies ON movies2directors.movieid = movies.movieid WHERE movies.country = 'UK' AND movies2directors.genre = 'Adventure' AND movies.isenglish = 'F' LIMIT 5
Database: movielens
Note: The audience and users are the same meaning; Female users refers to u_gender = 'F'; Percentage of female users = count(female users) / count(all users); count(all users) = count(female users) + count(male users);
Question: What is the percentage of female audiences who viewed movies with rating 2?
SQL: SELECT cast(sum(iif(users.u_gender = 'F', 1, 0)) AS REAL) * 100 / count(users.userid) FROM u2base INNER JOIN users ON u2base.userid = users.userid WHERE u2base.rating = 2
Database: movielens
Note: The audience and users are the same meaning; Difference of female and male audiences = count(female users) - count(male users); Female users refers to u_gender = 'F'; Male users refers to u_gender = 'M';
Question: What is the difference of female and male audiences in number who viewed horror movies?
SQL: SELECT sum(iif(users.u_gender = 'F', 1, 0)) - sum(iif(users.u_gender = 'M', 1, 0)) FROM u2base INNER JOIN users ON u2base.userid = users.userid INNER JOIN movies2directors ON movies2directors.movieid = u2base.movieid WHERE movies2directors.genre = 'horror'
Database: movielens
Note: year contains relative value, higher year value refers to newer date; year = 4 refers to newest date, year = 1 refer to oldest date; In English means isenglish = T;
Question: Please list the genre of the movies that are the newest and is in English.
SQL: SELECT movies2directors.genre FROM movies INNER JOIN movies2directors ON movies.movieid = movies2directors.movieid WHERE movies.year = 4 AND movies.isenglish = 'T'
Database: movielens
Note: USA is a country; not in English can be represented by isenglish = 'F';
Question: Among the action movies from the USA, how many of them are not in English?
SQL: SELECT count(movies.movieid) FROM movies INNER JOIN movies2directors ON movies.movieid = movies2directors.movieid WHERE movies.country = 'USA' AND movies.isenglish = 'F' AND movies2directors.genre = 'Action'