Chinastark/bird_dataset huggingface dataset:
Database: mondial_geo
Question: Which Zaire region is home to the country's deepest lake's Name it and list its depth.
SQL: SELECT T3.Name, T1.Name, T1.Depth FROM lake AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T4.Name = 'Zaire'
Database: mondial_geo
Question: What is the maximal elevation of the summit of the shortest mountain that can be found in the island of Madagaskar? Indicate what type of mountain it is.
Evidence: The elevation of the summit refers to height
SQL: SELECT T3.Height, T3.Type FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T1.Name = 'Madagaskar' ORDER BY T3.Height DESC LIMIT 1
Database: mondial_geo
Question: Which nation, with a population ranging from 60,000,000 to 99,000,000, has the greatest gross domestic product?
Evidence: GDP refers to gross domestic product; Nation and country are synonyms
SQL: SELECT T1.Name, T2.GDP FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Population BETWEEN 60000000 AND 90000000 ORDER BY T2.GDP DESC LIMIT 1
Database: mondial_geo
Question: Which Asian country gave its agricultural sector the largest share of its gross domestic product?
Evidence: Gross domestic product = GDP; Largest share of GDP in agricultural sector was mentioned in economy.Agriculture
SQL: SELECT T2.Country FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T2.Country = T3.Code INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Asia' ORDER BY T4.Agriculture DESC LIMIT 1
Database: mondial_geo
Question: What form of governance does the least prosperous nation in the world have?
Evidence: Nation and country are synonyms; Form of governance was mentioned in politics.Government; Least prosperous means lowest GDP
SQL: SELECT T3.Government FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country WHERE T2.GDP IS NOT NULL ORDER BY T2.GDP ASC LIMIT 1
Database: mondial_geo
Question: What year saw the greatest number of organizations created on the European continent?
SQL: SELECT STRFTIME('%Y', T4.Established) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T2.Country = T3.Code INNER JOIN organization AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Europe' GROUP BY STRFTIME('%Y', T4.Established) ORDER BY COUNT(T4.Name) DESC LIMIT 1
Database: mondial_geo
Question: What other country does the most populated nation in the world share a border with and how long is the border between the two nations?
Evidence: Nation and country are synonyms
SQL: SELECT T2.Country2, T2.Length FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 WHERE T1.Name = ( SELECT Name FROM country ORDER BY Population DESC LIMIT 1 )
Database: mondial_geo
Question: What is the population density of the nation whose capital city is in the Distrito Federal province, and what portion of its gross domestic product is devoted to its industries?
Evidence: ation and country are synonyms; Gross domestic product = GDP; Portion of GDP devoted to industries appears in economy.Industry; Population Density = Population / Area
SQL: SELECT T1.Population / T1.Area, T2.Industry FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Province = 'Distrito Federal'
Database: mondial_geo
Question: Lists all governments with a parliamentary democracy that achieved their independence between 01/01/1950 and 12/31/1999.
Evidence: Inhabitants, synonymous with population
SQL: SELECT * FROM politics WHERE STRFTIME('%Y', Independence) BETWEEN '1950' AND '1999' AND Government = 'parliamentary democracy'
Database: mondial_geo
Question: What percentage of countries became independent during the year 1960?
Evidence: Percentage = count(countries independent 1960) / total num of countries
SQL: SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Independence) = '1960' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Country) FROM politics
Database: mondial_geo
Question: List all deserts that are not between latitudes 30 and 40.
SQL: SELECT Name FROM desert WHERE Latitude < 30 OR Latitude > 40
Database: mondial_geo
Question: Indicate the coordinates of all the deserts whose area is in more than one country.
Evidence: coordinates consists of Latitude, Longitude
SQL: SELECT T1.Latitude, T1.Longitude FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert GROUP BY T1.Name, T1.Latitude, T1.Longitude HAVING COUNT(T1.Name) > 1
Database: mondial_geo
Question: What is the provincial capital of the province with a population of less than 80,000 that has the highest average population per area?
Evidence: Average population per area = population / area
SQL: SELECT CapProv FROM province WHERE Population < 80000 ORDER BY Population / Area DESC LIMIT 1
Database: software_company
Question: How many customers have never married?
Evidence: MARITAL_STATUS = 'Never-married';
SQL: SELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Never-married'
Database: software_company
Question: Among all the customers, how many of them are teenagers?
Evidence: teenager is a person aged between 13 and 19 years;
SQL: SELECT COUNT(ID) FROM Customers WHERE age >= 13 AND age <= 19
Database: software_company
Question: Please list the occupations of the customers with an education level of 11.
Evidence: education level of 11 refers to EDUCATIONNUM = 11;
SQL: SELECT DISTINCT OCCUPATION FROM Customers WHERE EDUCATIONNUM = 11
Database: software_company
Question: Of the first 60,000 customers' responses to the incentive mailing sent by the marketing department, how many of them are considered a true response?
Evidence: RESPONSE = 'true';
SQL: SELECT COUNT(REFID) custmoer_number FROM Mailings1_2 WHERE RESPONSE = 'true'
Database: software_company
Question: Among the customers over 30, how many of them are Machine-op-inspcts?
Evidence: over 30 refers to age > 30; OCCUPATION = 'Machine-op-inspct';
SQL: SELECT COUNT(ID) FROM Customers WHERE OCCUPATION = 'Machine-op-inspct' AND age > 30
Database: software_company
Question: How many female customers have an education level of over 11?
Evidence: education level of 11 refers to EDUCATIONNUM = 11; SEX = 'Female';
SQL: SELECT COUNT(ID) FROM Customers WHERE EDUCATIONNUM > 11 AND SEX = 'Female'
Database: software_company
Question: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are female?
Evidence: RESPONSE = 'true'; SEX = 'Female';
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.SEX = 'Female' AND T2.RESPONSE = 'true'
Database: software_company
Question: Please list the occupations of the customers over 40 and have sent a true response to the incentive mailing sent by the marketing department.
Evidence: over 40 refers to age > 40; RESPONSE = 'true';
SQL: SELECT DISTINCT T1.OCCUPATION FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.age > 40 AND T2.RESPONSE = 'true'
Database: software_company
Question: Among the male customers, how many of them come from a place with over 30,000 inhabitants?
Evidence: SEX = 'Male', over 30,000 inhabitants refer to NHABITANTS_K > 30; place refers to GEOID;
SQL: SELECT COUNT(T1.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T2.INHABITANTS_K > 30
Database: software_company
Question: How many customers are from the place with the highest average income per month?
Evidence: place with the highest average income per month refers to GEOID where MAX(INCOME_K);
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INCOME_K DESC LIMIT 1
Database: software_company
Question: Among the customers from a place with more than 20,000 and less than 30,000 inhabitants, how many of them are Machine-op-inspcts?
Evidence: place with more than 20,000 and less than 30,000 inhabitants refers to GEOID where INHABITANTS_K BETWEEN 20 AND 30; OCCUPATION = 'Machine-op-inspct';
SQL: SELECT COUNT(T1.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Machine-op-inspct' AND T2.INHABITANTS_K > 20 AND T2.INHABITANTS_K < 30
Database: software_company
Question: Which customer come from a place with more inhabitants, customer no.0 or customer no.1?
Evidence: place with more inhabitants refers to GEOID where ID = 0 OR ID = 1 and MAX(NHABITANTS_K);
SQL: SELECT T1.ID FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.ID = 0 OR T1.ID = 1 ORDER BY INHABITANTS_K DESC LIMIT 1
Database: software_company
Question: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are from a place with more than 30,000 inhabitants?
Evidence: RESPONSE = 'true'; place with more than 30,000 inhabitants refers to GEOID where INHABITANTS_K > 30;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T3.INHABITANTS_K > 30 AND T2.RESPONSE = 'true'
Database: software_company
Question: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are divorced males?
Evidence: RESPONSE = 'true'; SEX = 'Male'; MARITAL_STATUS = 'Divorced';
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced' AND T2.RESPONSE = 'true'
Database: software_company
Question: How many of the first 60,000 customers from the place with the highest average income per month have sent a true response to the incentive mailing sent by the marketing department?
Evidence: place with the highest average income per month refers to GEOID where MAX(INCOME_K); RESPONSE = 'true';
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T2.RESPONSE = 'true' ORDER BY T3.INCOME_K DESC LIMIT 1
Database: software_company
Question: What is the number of inhabitants of the place the most customers are from?
Evidence: the most customers are from refers to GEOID where MAX(COUNT(ID)); number of inhabitants refers to INHABITANTS_K;
SQL: SELECT DISTINCT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INHABITANTS_K DESC
Database: software_company
Question: Among the customers who come from the place with 25746 inhabitants, how many of them are male?
Evidence: place with 44114 inhabitants refers to GEOID where INHABITANTS_K = 44.114; SEX = 'Male';
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K = 25.746 AND T1.SEX = 'Male'
Database: software_company
Question: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are teenagers?
Evidence: RESPONSE = 'true'; teenagers are people aged between 13 and 19 years;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.age >= 13 AND T1.age <= 19 AND T2.RESPONSE = 'true'
Database: software_company
Question: What is the average education level of customers from the place with the highest average income per month?
Evidence: place with the highest average income per month refers to GEOID where MAX(INCOME_K); average education level refers to AVG(EDUCATIONNUM);
SQL: SELECT AVG(T1.EDUCATIONNUM) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INCOME_K DESC LIMIT 1
Database: software_company
Question: What is the average age of first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department?
Evidence: RESPONSE = 'true'; AVG(age);
SQL: SELECT AVG(T1.age) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T2.RESPONSE = 'true'
Database: software_company
Question: How many of the customers are male?
Evidence: SEX = 'Male';
SQL: SELECT COUNT(ID) FROM Customers WHERE SEX = 'Male'
Database: software_company
Question: List down the customer's geographic identifier who are handlers or cleaners.
Evidence: geographic identifier refers to GEOID; OCCUPATION = 'Handlers-cleaners';
SQL: SELECT GEOID FROM Customers WHERE OCCUPATION = 'Handlers-cleaners'
Database: software_company
Question: What is the total number of customers with an age below 30?
Evidence: age below 30 refers to age < 30;
SQL: SELECT COUNT(ID) FROM Customers WHERE age < 30
Database: software_company
Question: List down the geographic identifier with an income that ranges from 2100 to 2500.
Evidence: geographic identifier with an income that ranges from 2100 to 2500 refers to GEOID where INCOME_K BETWEEN 2100 AND 2500;
SQL: SELECT GEOID FROM Demog WHERE INCOME_K >= 2100 AND INCOME_K <= 2500
Database: software_company
Question: In geographic identifier from 20 to 50, how many of them has a number of inhabitants below 20?
Evidence: geographic identifier from 20 to 50 refers to GEOID BETWEEN 20 AND 50; number of inhabitants below 20 refers to INHABITANTS_K < 20;
SQL: SELECT COUNT(GEOID) FROM Demog WHERE INHABITANTS_K < 20 AND GEOID >= 20 AND GEOID <= 50
Database: software_company
Question: What is the number of inhabitants and income of geographic identifier 239?
Evidence: geographic identifier 239 refers to GEOID = 239; number of inhabitants refers to INHABITANTS_K; income refers to INCOME_K;
SQL: SELECT INHABITANTS_K FROM Demog WHERE GEOID = 239
Database: software_company
Question: Give the level of education and occupation of customers ages from 20 to 35 with an income K of 2000 and below.
Evidence: customers ages from 20 to 35 refer to ID where age BETWEEN 20 AND 35; income K of 2000 and below refers to INCOME_K < 2000; level of education refers to EDUCATIONNUM;
SQL: SELECT T1.EDUCATIONNUM, T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K < 2000 AND T1.age >= 20 AND T1.age <= 35
Database: software_company
Question: List down the number of inhabitants of customers with a divorced marital status and older than 50 years old.
Evidence: number of inhabitants refers to INHABITANTS_K; older than 50 years old refers to age < 50; MARITAL_STATUS = 'Divorced;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Divorced' AND T1.age < 50
Database: software_company
Question: What is the geographic identifier and income of the oldest customer?
Evidence: the oldest customer refers to MAX(age); geographic identifier refers to GEOID; income refers to INCOME_K;
SQL: SELECT T1.GEOID, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T1.age DESC LIMIT 1
Database: software_company
Question: Among the male customers with an level of education of 4 and below, list their income K.
Evidence: male customers with an level of education of 4 and below refer to SEX = 'Male' where EDUCATIONNUM < 4;
SQL: SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 4 AND SEX = 'Male' )
Database: software_company
Question: List the occupation and income of male customers with an level of education of 4 to 6.
Evidence: male customers with an level of education of 4 to 6 refer to SEX = 'Male' where EDUCATIONNUM BETWEEN 4 AND 6; income refers to INCOME_K;
SQL: SELECT T1.OCCUPATION, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.EDUCATIONNUM >= 4 AND T1.EDUCATIONNUM <= 6 AND T1.SEX = 'Male'
Database: software_company
Question: In widowed male customers ages from 40 to 60, how many of them has an income ranges from 3000 and above?
Evidence: widowed male customers ages from 40 to 60 refer to SEX = 'Male' where age BETWEEN 40 AND 60 and MARITAL_STATUS = 'Widowed'; income ranges from 3000 and above refers to INCOME_K BETWEEN 2000 AND 3000;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.age >= 40 AND T1.age <= 60 AND T1.MARITAL_STATUS = 'Widowed' AND T1.SEX = 'Male' AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 3000
Database: software_company
Question: What is the occupation of customers within number of inhabitants ranges of 30 to 40?
Evidence: number of inhabitants ranges of 30 to 40 refers to INHABITANTS_K BETWEEN 30 AND 40;
SQL: SELECT DISTINCT T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K >= 30 AND T2.INHABITANTS_K <= 40
Database: software_company
Question: Among the widowed female customers, give the income of those who has an level of education of 5 and below.
Evidence: widowed female customers refer to SEX = 'Female' where MARITAL_STATUS = 'Widowed'; level of education of 5 and below refers to EDUCATIONNUM ≤ 5;
SQL: SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 5 AND SEX = 'Female' AND MARITAL_STATUS = 'Widowed' )
Database: software_company
Question: List the marital status of customers within the age of 40 to 60 that has the highest income among the group.
Evidence: age of 40 to 60 refers to age BETWEEN 40 AND 60; the highest income refers to MAX(INCOME_K);
SQL: SELECT T1.MARITAL_STATUS FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.age >= 40 AND T1.age <= 60 ORDER BY T2.INCOME_K DESC LIMIT 1
Database: software_company
Question: What is the number of inhabitants of male customers ages from 20 to 30 years old who are farming or fishing?
Evidence: male customers ages from 20 to 30 years old refer to SEX = 'Male' where age BETWEEN 20 AND 30; farming or fishing refers to OCCUPATION; number of inhabitants refers to INHABITANTS_K;
SQL: SELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 30
Database: software_company
Question: Among the customers with a marital status of married-civ-spouse, list the number of inhabitants and age of those who are machine-op-inspct.
Evidence: OCCUPATION = 'Machine-op-inspct'; number of inhabitants refers to INHABITANTS_K;
SQL: SELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 30
Database: software_company
Question: In female customers ages from 50 to 60, how many of them has an number of inhabitants ranges from 19 to 24?
Evidence: female customers ages from 50 to 60 refer to SEX = 'Female' where age BETWEEN 50 AND 60; number of inhabitants ranges from 19 to 24 refers to INHABITANTS_K BETWEEN 19 AND 24;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.age >= 50 AND T1.age <= 60 AND T2.INHABITANTS_K >= 19 AND T2.INHABITANTS_K <= 24
Database: software_company
Question: List the income and number of inhabitants of customers with an age greater than the 80% of average age of all customers?
Evidence: age greater than the 80% of average age refers to age > (AVG(age) * 0.8); income refers to INCOME_K; number of inhabitants refers to INHABITANTS_K;
SQL: SELECT T2.INCOME_K, T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID GROUP BY T2.INCOME_K, T2.INHABITANTS_K HAVING T1.age > 0.8 * AVG(T1.age)
Database: software_company
Question: In customers with marital status of never married, what is the percentage of customers with income of 2500 and above?
Evidence: DIVIDE(COUNT(INCOME_K ≥ 2500 where MARITAL_STATUS = 'Never-married'), COUNT(INCOME_K where MARITAL_STATUS = 'Never-married')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.INCOME_K > 2500 THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Never-married'
Database: software_company
Question: Find and list the id and geographic ID of the elderly customers with an education level below 3.
Evidence: elderly customers with an education level below 3 refer to age > 65 where EDUCATIONNUM < 3; geographic ID refers to GEOID;
SQL: SELECT ID, GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND age > 65
Database: software_company
Question: List the geographic id of places where the income is above average.
Evidence: geographic ID refers to GEOID; income is above average refers to INCOME_K > DIVIDE(SUM(INCOME_K), COUNT(GEOID));
SQL: SELECT AVG(INCOME_K) FROM Demog
Database: software_company
Question: Calculate the number of customers who did not respond in February of 2007.
Evidence: did not respond refers to RESPONSE = 'false'; February of 2007 refers to REF_DATE BETWEEN '2007-02-01 12:00:00.0'AND '2007-02-28 12:00:00.0';
SQL: SELECT COUNT(REFID) custmoer_number FROM Mailings1_2 WHERE RESPONSE = 'false' AND REF_DATE BETWEEN '2007-02-01' AND '2007-02-28'
Database: software_company
Question: How many teenagers are working as Machine-op-inspct?
Evidence: teenager is a person aged between 13 and 19 years; OCCUPATION = 'Machine-op-inspct';
SQL: SELECT COUNT(ID) teenager_number FROM Customers WHERE OCCUPATION = 'Machine-op-inspct' AND age >= 13 AND age <= 19
Database: software_company
Question: Of customers who provide other services, how many are from places where inhabitants are more than 20000?
Evidence: OCCUPATION = 'Other-service'; inhabitants are more than 20000 refer to INHABITANTS_K > 20;
SQL: SELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Other-service' AND T2.INHABITANTS_K > 20
Database: software_company
Question: Among the male customer in their twenties, how many are from places where the average income is more than 3000?
Evidence: male customer in their twenties refer to SEX = 'Male' where age BETWEEN 20 AND 29; average income is more than 3000 refers to INCOME_K > 3000;
SQL: SELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T2.INCOME_K > 3000 AND T1.age >= 20 AND T1.age <= 29
Database: software_company
Question: What percentage of elderly customers who are never married in the place with geographic ID 24?
Evidence: elderly customers refer to age > 65; DIVIDE(COUNT(ID where age > 65, MARITAL_STATUS = 'never married' and GEOID = 24), COUNT(ID where GEOID = 24)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T1.MARITAL_STATUS = 'never married' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.GEOID = 24
Database: software_company
Question: Among the customers with an average income per inhabitant above 3000, what percentage are in their eighties?
Evidence: average income per inhabitant above 3000 refers to INCOME_K > 3000; eighties refer to age BETWEEN 80 AND 89; DIVIDE(COUNT(INCOME_K > 3000 and age BETWEEN 80 AND 89), COUNT(INCOME_K > 3000 )) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T1.age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K > 3000
Database: software_company
Question: How many of the customer's reference ID that has a TRUE response?
Evidence: reference ID refers to REFID;
SQL: SELECT COUNT(REFID) FROM Mailings1_2 WHERE RESPONSE = 'true'
Database: software_company
Question: List down the customer's reference ID with true response.
Evidence: reference ID refers to REFID;
SQL: SELECT REFID FROM Mailings1_2 WHERE RESPONSE = 'true'
Database: software_company
Question: What is the total number of widowed customers with an age below 50?
Evidence: widowed customers with an age below 50 refer to MARITAL_STATUS = 'Widowed' where age < 50;
SQL: SELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Widowed' AND age < 50