Chinastark/bird_dataset huggingface dataset:
Database: sales_in_weather
Note: item number 5 refers to item_nbr = 5; sold highest quantity refers to Max(Sum(units)); station refers to station_nbr;
Question: Which station sold the highest quantity of item number 5 overall?
SQL: SELECT relation.station_nbr FROM sales_in_weather INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 5 GROUP BY relation.station_nbr ORDER BY sum(sales_in_weather.units) DESC LIMIT 1
Database: sales_in_weather
Note: in February 2012 refers to SUBSTR(date, 1, 7) = '2012-02'; earliest sunrise Min(sunrise);  station with no more than 1 store refers to station_nbr where Count(store_nbr) = 1;
Question: What is the earliest sunrise recorded in the stations with no more than 1 store in February 2012?
SQL: SELECT relation.station_nbr FROM relation INNER JOIN weather ON relation.station_nbr = weather.station_nbr WHERE sunrise IS NOT NULL AND weather.`date` LIKE '%2012-02%' AND relation.station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING count(store_nbr) = 1 ) ORDER BY sunrise LIMIT 1
Database: sales_in_weather
Note: weather station 17 refers to station_nbr = 17; item 45 refers to item_nbr = 45; in October 2012 refers to SUBSTR(date, 1, 7) = '2012-10': highest quantity refers to Max(Sum(units)); store refers to store_nbr;
Question: In weather station 17, which store sold the highest quantity of item 45 in October 2012?
SQL: SELECT sales_in_weather.store_nbr FROM sales_in_weather INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 45 AND relation.station_nbr = 17 AND sales_in_weather.`date` LIKE '%2012-10%' GROUP BY sales_in_weather.store_nbr ORDER BY sum(sales_in_weather.units) DESC LIMIT 1
Database: sales_in_weather
Note: thickest snowfall refers to Max(snowfall); item refers to item_nbr;
Question: What are the items sold by the store during the day whose station recorded the thickest snowfall?
SQL: SELECT sales_in_weather.item_nbr FROM sales_in_weather INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr INNER JOIN ( SELECT station_nbr, `date` FROM weather ORDER BY snowfall DESC LIMIT 1 ) AS t3 ON relation.station_nbr = t3.station_nbr
Database: sales_in_weather
Note: highest quantity refers to Max(units); station refers to station_nbr;
Question: What are the top 3 stations that have sold the highest quantities for an item in a single day?
SQL: SELECT relation.station_nbr FROM sales_in_weather INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr ORDER BY sales_in_weather.units DESC LIMIT 3
Database: sales_in_weather
Note: highest recorded heat refers to Max(heat); station refers to station_nbr;
Question: How many stores belong to the station with the highest recorded heat of all time?
SQL: SELECT count(relation.store_nbr) FROM ( SELECT station_nbr FROM weather ORDER BY heat DESC LIMIT 1 ) AS t1 INNER JOIN relation ON t1.station_nbr = relation.station_nbr
Database: sales_in_weather
Note: On February 8, 2014 refers to date = '2014-02-08'; store 29 refers to store_nbr = 29; minimum temperature refers to tmin; station refers to station_nbr;
Question: On February 8, 2014, what is the minimum temperature in the station where store 29 belongs?
SQL: SELECT tmin FROM relation INNER JOIN weather ON relation.station_nbr = weather.station_nbr WHERE relation.store_nbr = 29 AND weather.`date` = '2014-02-08'
Database: sales_in_weather
Note: station with 3 stores refers to station_nbr where Count(store_nbr) = 3; station pressure of no more than 30 refers to stnpressure < 30; On February 18, 2014 refers to date = '2014-02-18';
Question: Among the stations with 3 stores, how many stations have a station pressure of no more than 30 on February 18, 2014?
SQL: SELECT count(station_nbr) FROM weather WHERE `date` = '2014-02-18' AND stnpressure < 30 AND station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING count(store_nbr) = 3 )
Database: sales_in_weather
Note: station with highest number of stores refers to station_nbr where Max(Count(store_nbr)); station refers to station_nbr; in February 2012 refers to substring (date, 1, 7) = '2012-02'; average maximum temperature = Divide(Sum(tmax), 29);
Question: Which station has the highest number of stores? Calculate the said station's average maximum temperature in February 2012.
SQL: SELECT cast(sum(weather.tmax) AS REAL) / 29 FROM ( SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY count(store_nbr) DESC LIMIT 1 ) AS t1 INNER JOIN weather ON t1.station_nbr = weather.station_nbr WHERE substr(weather.`date`, 1, 7) = '2012-02'
Database: sales_in_weather
Note: weather station 12 refers to station_nbr = 12; item 5 refers to item_nbr = 5; 10 store refers to store_nbr = 10; in 2014 refers to SUBSTR(date, 1, 4) = '2014'; percentage = Divide (Sum(units where store_nbr = 10), Sum(units)) * 100;
Question: Between the stores under weather station 12, what is the percentage of item 5 sold in store 10 in 2014?
SQL: SELECT cast(sum(CASE WHEN sales_in_weather.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / sum(units) FROM relation INNER JOIN sales_in_weather ON relation.store_nbr = sales_in_weather.store_nbr WHERE station_nbr = 12 AND item_nbr = 5 AND sales_in_weather.`date` LIKE '%2014%'
Database: sales_in_weather
Note: maximum average speed refers to Max(avgspeed);
Question: What is the maximum average speed?
SQL: SELECT max(avgspeed) FROM weather
Database: sales_in_weather
Note: snow fell more than 5 inches refers to snowfall > 5;
Question: How many days did the show fell more than 5 inches?
SQL: SELECT count(DISTINCT `date`) FROM weather WHERE snowfall > 5
Database: sales_in_weather
Note: sunrise before 5 Am refers to sunrise < time ('5:00:00');
Question: How many days did the sun rise before 5 AM?
SQL: SELECT count(DISTINCT `date`) AS days FROM weather WHERE sunrise < time('05:00:00')
Database: sales_in_weather
Note: minimum dew point refers to Min(dewpoint);
Question: What is the minimum dew point?
SQL: SELECT min(dewpoint) FROM weather
Database: sales_in_weather
Note: station number 1 refers to station_nbr = 1 ; minimum temperature = tmin; maximum temperature = tmax; on 15 January 2012 refers to date = '2012-01-15';
Question: What is the maximum and minimum temperature for station number 1 on 15 January 2012?
SQL: SELECT tmax, tmin FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-15'
Database: sales_in_weather
Note: item 5 refers to item_nbr = 5; on January 2014 refers to Substring (date, 1, 7) = '2014-01';
Question: How many stations were able to sell item 5 on January 2014?
SQL: SELECT count(DISTINCT relation.station_nbr) AS number FROM sales_in_weather INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE substr(`date`, 1, 7) = '2014-01' AND item_nbr = 5
Database: sales_in_weather
Note: lowest minimum temperature refers to Min(tmin); store 16 refers to store_nbr = 16; on January 2012 refers to Substring (date, 1, 7) = '2012-01';
Question: What is the lowest minimum temperature recorded in store 16 on January 2012?
SQL: SELECT min(tmin) FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr WHERE relation.store_nbr = 16 AND weather.`date` LIKE '%2012-01%'
Database: sales_in_weather
Note: item 7 refers to item_nbr = 7; store 7 refers to store_nbr = 7; snow is less than 5 inches refers to snowfall < 5;
Question: How many units of item 7 have been sold by store 7 when the snow is less than 5 inches?
SQL: SELECT sum(units) FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr INNER JOIN sales_in_weather ON relation.store_nbr = sales_in_weather.store_nbr WHERE relation.store_nbr = 7 AND sales_in_weather.item_nbr = 7 AND weather.snowfall < 5
Database: sales_in_weather
Note: store 9 refers to store_nbr = 9; snowy day refers to snowfall < > 0 and snowfall is not null; item refers to item_nbr;
Question: How many items were sold by store 9 during a snowy day?
SQL: SELECT count(DISTINCT item_nbr) FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr INNER JOIN sales_in_weather ON relation.store_nbr = sales_in_weather.store_nbr WHERE sales_in_weather.store_nbr = 9 AND weather.snowfall <> 0 AND weather.snowfall IS NOT NULL
Database: sales_in_weather
Note: station number refers to station_nbr; store 17 refers to store_nbr = 17;
Question: List out stations number and items sold by store 17.
SQL: SELECT relation.station_nbr, sales_in_weather.item_nbr FROM relation INNER JOIN sales_in_weather ON relation.store_nbr = sales_in_weather.store_nbr WHERE relation.store_nbr = 17 GROUP BY relation.station_nbr, sales_in_weather.item_nbr
Database: sales_in_weather
Note: store 35 refers to store_nbr = 35; haze is recorded refers to codesum like '%'||'HZ'||'%';
Question: List out dates when haze is recorded in store 35.
SQL: SELECT weather.`date` FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr WHERE relation.store_nbr = 35 AND weather.codesum LIKE '%' OR 'HZ' OR '%'
Database: sales_in_weather
Note: store number 3 refers to store_nbr = 3; average speed refers to avgspeed; store number 4 refers to store_nbr = 4;
Question: What is the sea level and average speed for store number 3 and store number 4?
SQL: SELECT weather.sealevel, weather.avgspeed FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr WHERE relation.store_nbr = 3 OR relation.store_nbr = 4
Database: sales_in_weather
Note: store 1 refers to store_nbr = 1; highest unit sold refers to Max(units); during rainy day refers to codesum like '%'||'RA'||'%'; item refers to item_nbr;
Question: Which items from store 1 have the highest units sold during rainy day?
SQL: SELECT sales_in_weather.item_nbr FROM weather INNER JOIN sales_in_weather ON weather.`date` = sales_in_weather.`date` INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr AND weather.station_nbr = relation.station_nbr WHERE sales_in_weather.store_nbr = 1 AND weather.codesum LIKE '%' OR 'RA' OR '%' GROUP BY sales_in_weather.item_nbr ORDER BY sales_in_weather.units DESC LIMIT 1
Database: sales_in_weather
Note: store 11 refers to store_nbr = 11; highest temperature refers to Max(tmax); lowest temperature refers to Min(tmin); ration = Divide (Max(tmax), Min(tmin));
Question: What is the ratio of the highest and lowest temperature in store 11?
SQL: SELECT cast((max(weather.tmax) - min(weather.tmin)) AS REAL) / min(weather.tmin) FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr WHERE relation.store_nbr = 11
Database: sales_in_weather
Note: station 1 refers to station_nbr = 1; station 2 refers to station_nbr = 2; on year 2012 refers to substring (date, 1, 4) = '2012'; difference = Subtract (Sum(units where station_nbr = 1), Sum(units where station_nbr = 2));
Question: What was the difference of number of units sold in station number 1 and number 2 on year 2012?
SQL: SELECT sum(CASE WHEN relation.station_nbr = 1 THEN units ELSE 0 END) - sum(CASE WHEN relation.station_nbr = 2 THEN units ELSE 0 END) FROM relation INNER JOIN sales_in_weather ON relation.store_nbr = sales_in_weather.store_nbr WHERE sales_in_weather.`date` LIKE '%2012%'
Database: sales_in_weather
Note: store number 18 refers to store_nbr = 18; store number 19 refers to store_nbr = 19; on 16 September 2022 refers to date = '2022-09-16'; average temperature difference = Subtract(tavg where store_nbr = 18, tavg where store_nbr = 19);
Question: What was the average temperature difference between store number 18 and 19 on 16 September 2022?
SQL: SELECT sum(CASE WHEN relation.store_nbr = 18 THEN weather.tavg ELSE 0 END) - sum(CASE WHEN relation.store_nbr = 19 THEN weather.tavg ELSE 0 END) FROM relation INNER JOIN weather ON relation.station_nbr = weather.station_nbr WHERE weather.`date` = '2012-09-16'
Database: sales_in_weather
Note: item 1 refers to item_nbr = 1; when the average temperature is 83 refers to tavg = 83;
Question: How many units are being sold for item 1 when the average temperature is 83?
SQL: SELECT sum(units) FROM weather INNER JOIN sales_in_weather ON weather.`date` = sales_in_weather.`date` INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 1 AND weather.tavg = 83
Database: sales_in_weather
Note: item 1 refers to item_nbr = 1; when the sunset earliest refers to Min(sunset); latest sunset refers to Max(sunset); difference unit sold refers to Subtract(Sum(units where Min(sunset)), Sum(units where Max(sunset)));
Question: What is the difference between the units sold for item 1 when the sunset was the earliest and the latest?
SQL: SELECT ( SELECT sum(sales_in_weather.units) AS sumunit FROM weather INNER JOIN sales_in_weather ON weather.`date` = sales_in_weather.`date` INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 5 AND sunset IS NOT NULL GROUP BY weather.sunset ORDER BY weather.sunset LIMIT 1 ) - ( SELECT sum(sales_in_weather.units) AS sumunit FROM weather INNER JOIN sales_in_weather ON weather.`date` = sales_in_weather.`date` INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 5 AND sunset IS NOT NULL GROUP BY weather.sunset ORDER BY weather.sunset DESC LIMIT 1 )
Database: sales_in_weather
Note: item 10 refers to item_nbr = 10; average temperature below median temperature refers to tavg < avg(tavg); total units refers to Sum(units);
Question: What was the total unit sold for item 10 when the average temperature was below the median temperature?
SQL: SELECT sum(sales_in_weather.units) FROM weather INNER JOIN sales_in_weather ON weather.`date` = sales_in_weather.`date` INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 10 AND weather.tavg < ( SELECT avg(weather.tavg) FROM weather INNER JOIN sales_in_weather ON weather.`date` = sales_in_weather.`date` INNER JOIN relation ON sales_in_weather.store_nbr = relation.store_nbr WHERE sales_in_weather.item_nbr = 10 )
Database: sales_in_weather
Note: during May 2012 refers to SUBSTR(date, 1, 7) = '2012-05'; store number 6 refers to store_nbr = 6; store number 7 refers to store_nbr = 7; average temperature difference = Subtract (Divide (Sum(tavg), Count (date) where the store_nbr = 6), Divide (Sum(tavg), Count(date) where store_nbr = 7));
Question: What was the average temperature differences during May 2012 for store number 6 and 7?
SQL: SELECT ( SELECT cast(sum(tavg) AS REAL) / count(`date`) FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr AND weather.`date` LIKE '%2012-05%' AND relation.store_nbr = 6 ) - ( SELECT cast(sum(tavg) AS REAL) / count(`date`) FROM weather INNER JOIN relation ON weather.station_nbr = relation.station_nbr WHERE weather.`date` LIKE '%2012-05%' AND relation.store_nbr = 7 )
Database: mondial_geo
Question: In which country does Polish found least in?
SQL: SELECT country.name FROM ethnicgroup INNER JOIN country ON ethnicgroup.country = country.code WHERE ethnicgroup.name = 'Polish' GROUP BY country.name, ethnicgroup.percentage ORDER BY ethnicgroup.percentage ASC LIMIT 1
Database: mondial_geo
Note: percentage = 90 means 90% of the population;
Question: Which countries have more than 90% of African? List the name of the country in full.
SQL: SELECT country.name FROM ethnicgroup INNER JOIN country ON ethnicgroup.country = country.code WHERE ethnicgroup.name = 'African' AND ethnicgroup.percentage > 90
Database: mondial_geo
Question: State the different ethnic group and percentage of the language in Singapore.
SQL: SELECT ethnicgroup.name, ethnicgroup.percentage FROM ethnicgroup INNER JOIN country ON ethnicgroup.country = country.code WHERE country.name = 'Singapore' GROUP BY ethnicgroup.name, ethnicgroup.percentage
Database: mondial_geo
Question: Calculate the percentage of country which gained independence as republic after 1970.
SQL: SELECT cast(sum(CASE WHEN government = 'republic' THEN 1 ELSE 0 END) AS REAL) * 100 / count(country) FROM politics WHERE strftime('%Y', independence) > '1970'
Database: mondial_geo
Question: Find the GPD for Bosnia and Herzegovina and the type of government it belongs to.
SQL: SELECT economy.gdp, politics.government FROM economy INNER JOIN politics ON economy.country = politics.country INNER JOIN country ON country.code = politics.country WHERE country.name = 'Bosnia and Herzegovina'
Database: mondial_geo
Question: State the country and its population with population growth greater than 2% but infant mortality rate less than 5%.
SQL: SELECT country.name, country.population FROM country INNER JOIN population ON country.code = population.country WHERE population.population_growth > 2 AND population.infant_mortality < 5
Database: mondial_geo
Question: Which is the majority of the ethnic group in country with great than 10,000,000 population
SQL: SELECT ethnicgroup.name FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE country.population > 10000000 GROUP BY ethnicgroup.name, ethnicgroup.percentage ORDER BY ethnicgroup.percentage DESC LIMIT 2
Database: mondial_geo
Question: Provide the country with its full name which has the most ethnic group? List them all ethnic group together with its percentage.
SQL: SELECT country.name, ethnicgroup.name, ethnicgroup.percentage FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE country.name = ( SELECT country.name FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country GROUP BY country.name ORDER BY count(ethnicgroup.name) DESC LIMIT 1 ) GROUP BY country.name, ethnicgroup.name, ethnicgroup.percentage
Database: mondial_geo
Note: percentage = 100 means 100% of the population;
Question: What is the full name of the country with 100% Africans?
SQL: SELECT ethnicgroup.name FROM ethnicgroup INNER JOIN country ON ethnicgroup.country = country.code WHERE ethnicgroup.percentage = 100 AND ethnicgroup.name = 'African'
Database: mondial_geo
Question: List the infant mortality of country with the least Amerindian.
SQL: SELECT population.infant_mortality FROM population INNER JOIN ethnicgroup ON population.country = ethnicgroup.country WHERE ethnicgroup.name = 'Amerindian' ORDER BY ethnicgroup.percentage ASC LIMIT 1
Database: mondial_geo
Question: For country with area greater than 600000, what is agriculture percentage of GDP the country contributes?
SQL: SELECT economy.agriculture FROM country INNER JOIN economy ON country.code = economy.country WHERE country.area > 600000 AND economy.agriculture IS NOT NULL
Database: mondial_geo
Question: Provide the country with republic government which has the highest population growth?
SQL: SELECT politics.country FROM population INNER JOIN politics ON population.country = politics.country WHERE politics.government = 'republic' ORDER BY population.population_growth DESC LIMIT 1
Database: mondial_geo
Question: When did 'Bulgaria' gain independence?
SQL: SELECT politics.independence FROM country INNER JOIN politics ON country.code = politics.country WHERE country.name = 'Bulgaria'
Database: mondial_geo
Note: Arab is the name of enthic groups in the country; population of (Arab in each country) = (percentage of Arab) * (population of each country);
Question: Calculate the population of Arab in each country?
SQL: SELECT ethnicgroup.percentage * country.population FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE ethnicgroup.name = 'Arab'
Database: mondial_geo
Note: African is the name of enthic groups in the country; population of (African in Turks and Calcos island) = (percentage of African) * (population of Turks and Calcos island);
Question: What is the population of African in 'Turks and Caicos Islands'?
SQL: SELECT ethnicgroup.percentage * country.population FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE ethnicgroup.name = 'African' AND country.name = 'Turks and Caicos Islands'
Database: mondial_geo
Note: Growth population = population_growth * population;
Question: What is the number of growth population for country with the lowest infant mortality?
SQL: SELECT population.population_growth * country.population FROM country INNER JOIN population ON country.code = population.country WHERE population.infant_mortality IS NOT NULL ORDER BY population.infant_mortality ASC LIMIT 1
Database: mondial_geo
Question: Among countries with more than 400,000 GDP, state its capital and population.
SQL: SELECT country.capital, country.population FROM country INNER JOIN economy ON country.code = economy.country WHERE economy.gdp > 400000
Database: mondial_geo
Note: The service of gdp can be computed by service * gdp;
Question: Calculate the service of GDP for Brazil.
SQL: SELECT economy.service * economy.gdp FROM country INNER JOIN economy ON country.code = economy.country WHERE country.name = 'Brazil'
Database: mondial_geo
Question: Which country has the highest infant mortality? Also state its population growth.
SQL: SELECT country.name, population.population_growth FROM country INNER JOIN population ON country.code = population.country ORDER BY population.infant_mortality DESC LIMIT 1
Database: mondial_geo
Note: Negative growth in population means population_growth < 0;
Question: List all countries with negative growth in population. State the country, population and growth.
SQL: SELECT country.name, country.population, population.population_growth FROM country INNER JOIN population ON country.code = population.country WHERE population.population_growth < 0
Database: mondial_geo
Question: For countries with area between 500000 to 1000000, state the country and infant mortality rate.
SQL: SELECT country.name, population.infant_mortality FROM country INNER JOIN population ON country.code = population.country WHERE country.area BETWEEN 500000 AND 1000000
Database: mondial_geo
Note: population_growth = 3 means 3% population growth rate;
Question: Among the countries with more than 3% population growth rate, state the country name in full along with its GDP.
SQL: SELECT country.name, economy.gdp FROM country INNER JOIN population ON country.code = population.country INNER JOIN economy ON economy.country = population.country WHERE population.population_growth > 3
Database: mondial_geo
Note: Ethiopia is one of country names;
Question: What is the infant mortality rate for Ethiopia?
SQL: SELECT population.infant_mortality FROM country INNER JOIN population ON country.code = population.country WHERE country.name = 'Ethiopia'
Database: mondial_geo
Note: Singapore is one of country names; gdp refers to gross domestic products; gdp to the industry sector = gdp * industry;
Question: How much does the gross domestic products goes to the industry sector for Singapore?
SQL: SELECT economy.gdp * economy.industry FROM country INNER JOIN economy ON country.code = economy.country WHERE country.name = 'Singapore'
Database: mondial_geo
Question: How much is her GDP in agriculture for the country with the least area?
SQL: SELECT economy.gdp * economy.agriculture FROM country INNER JOIN economy ON country.code = economy.country ORDER BY country.area ASC LIMIT 1
Database: mondial_geo
Question: Which country has the biggest percentage of the albanian ethnic group?
SQL: SELECT country.name FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE ethnicgroup.name = 'Albanian' ORDER BY ethnicgroup.percentage DESC LIMIT 1
Database: mondial_geo
Question: Among the countries with the African ethnic group, how many of them has a population of over 10000000?
SQL: SELECT count(country.name) FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE ethnicgroup.name = 'African' AND country.area > 10000000
Database: mondial_geo
Question: Please list the name of the countries with over 5 ethnic groups.
SQL: SELECT country.name FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country GROUP BY country.name HAVING count(country.name) > 5
Database: mondial_geo
Question: Which country has the highest GDP?
SQL: SELECT country.name FROM country INNER JOIN economy ON country.code = economy.country ORDER BY economy.gdp DESC LIMIT 1