1sf/bird-sql-train-with-schema huggingface dataset:
Database: mondial_geo
Tables: borders, city, continent, country, desert, economy, encompasses, ethnicGroup, geo_desert, geo_estuary, geo_island, geo_lake, geo_mountain, geo_river, geo_sea, geo_source, island, islandIn, isMember, lake, language, located, locatedOn, mergesWith, mountain, mountainOnIsland, organization, politics, population, province, religion, river, sea, target
Columns (table index, column name): -1, *, 0, Country1, 0, Country2, 0, Length, 1, Name, 1, Country, 1, Province, 1, Population, 1, Longitude, 1, Latitude, 2, Name, 2, Area, 3, Name, 3, Code, 3, Capital, 3, Province, 3, Area, 3, Population, 4, Name, 4, Area, 4, Longitude, 4, Latitude, 5, Country, 5, GDP, 5, Agriculture, 5, Service, 5, Industry, 5, Inflation, 6, Country, 6, Continent, 6, Percentage, 7, Country, 7, Name, 7, Percentage, 8, Desert, 8, Country, 8, Province, 9, River, 9, Country, 9, Province, 10, Island, 10, Country, 10, Province, 11, Lake, 11, Country, 11, Province, 12, Mountain, 12, Country, 12, Province, 13, River, 13, Country, 13, Province, 14, Sea, 14, Country, 14, Province, 15, River, 15, Country, 15, Province, 16, Name, 16, Islands, 16, Area, 16, Height, 16, Type, 16, Longitude, 16, Latitude, 17, Island, 17, Sea, 17, Lake, 17, River, 18, Country, 18, Organization, 18, Type, 19, Name, 19, Area, 19, Depth, 19, Altitude, 19, Type, 19, River, 19, Longitude, 19, Latitude, 20, Country, 20, Name, 20, Percentage, 21, City, 21, Province, 21, Country, 21, River, 21, Lake, 21, Sea, 22, City, 22, Province, 22, Country, 22, Island, 23, Sea1, 23, Sea2, 24, Name, 24, Mountains, 24, Height, 24, Type, 24, Longitude, 24, Latitude, 25, Mountain, 25, Island, 26, Abbreviation, 26, Name, 26, City, 26, Country, 26, Province, 26, Established, 27, Country, 27, Independence, 27, Dependent, 27, Government, 28, Country, 28, Population_Growth, 28, Infant_Mortality, 29, Name, 29, Country, 29, Population, 29, Area, 29, Capital, 29, CapProv, 30, Country, 30, Name, 30, Percentage, 31, Name, 31, River, 31, Lake, 31, Sea, 31, Length, 31, SourceLongitude, 31, SourceLatitude, 31, Mountains, 31, SourceAltitude, 31, EstuaryLongitude, 31, EstuaryLatitude, 32, Name, 32, Depth, 33, Country, 33, Target
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
Tables: borders, city, continent, country, desert, economy, encompasses, ethnicGroup, geo_desert, geo_estuary, geo_island, geo_lake, geo_mountain, geo_river, geo_sea, geo_source, island, islandIn, isMember, lake, language, located, locatedOn, mergesWith, mountain, mountainOnIsland, organization, politics, population, province, religion, river, sea, target
Columns (table index, column name): -1, *, 0, Country1, 0, Country2, 0, Length, 1, Name, 1, Country, 1, Province, 1, Population, 1, Longitude, 1, Latitude, 2, Name, 2, Area, 3, Name, 3, Code, 3, Capital, 3, Province, 3, Area, 3, Population, 4, Name, 4, Area, 4, Longitude, 4, Latitude, 5, Country, 5, GDP, 5, Agriculture, 5, Service, 5, Industry, 5, Inflation, 6, Country, 6, Continent, 6, Percentage, 7, Country, 7, Name, 7, Percentage, 8, Desert, 8, Country, 8, Province, 9, River, 9, Country, 9, Province, 10, Island, 10, Country, 10, Province, 11, Lake, 11, Country, 11, Province, 12, Mountain, 12, Country, 12, Province, 13, River, 13, Country, 13, Province, 14, Sea, 14, Country, 14, Province, 15, River, 15, Country, 15, Province, 16, Name, 16, Islands, 16, Area, 16, Height, 16, Type, 16, Longitude, 16, Latitude, 17, Island, 17, Sea, 17, Lake, 17, River, 18, Country, 18, Organization, 18, Type, 19, Name, 19, Area, 19, Depth, 19, Altitude, 19, Type, 19, River, 19, Longitude, 19, Latitude, 20, Country, 20, Name, 20, Percentage, 21, City, 21, Province, 21, Country, 21, River, 21, Lake, 21, Sea, 22, City, 22, Province, 22, Country, 22, Island, 23, Sea1, 23, Sea2, 24, Name, 24, Mountains, 24, Height, 24, Type, 24, Longitude, 24, Latitude, 25, Mountain, 25, Island, 26, Abbreviation, 26, Name, 26, City, 26, Country, 26, Province, 26, Established, 27, Country, 27, Independence, 27, Dependent, 27, Government, 28, Country, 28, Population_Growth, 28, Infant_Mortality, 29, Name, 29, Country, 29, Population, 29, Area, 29, Capital, 29, CapProv, 30, Country, 30, Name, 30, Percentage, 31, Name, 31, River, 31, Lake, 31, Sea, 31, Length, 31, SourceLongitude, 31, SourceLatitude, 31, Mountains, 31, SourceAltitude, 31, EstuaryLongitude, 31, EstuaryLatitude, 32, Name, 32, Depth, 33, Country, 33, Target
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
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
Tables: Demog, mailings3, Customers, Mailings1_2, Sales
Columns (table index, column name): -1, *, 0, GEOID, 0, INHABITANTS_K, 0, INCOME_K, 0, A_VAR1, 0, A_VAR2, 0, A_VAR3, 0, A_VAR4, 0, A_VAR5, 0, A_VAR6, 0, A_VAR7, 0, A_VAR8, 0, A_VAR9, 0, A_VAR10, 0, A_VAR11, 0, A_VAR12, 0, A_VAR13, 0, A_VAR14, 0, A_VAR15, 0, A_VAR16, 0, A_VAR17, 0, A_VAR18, 1, REFID, 1, REF_DATE, 1, RESPONSE, 2, ID, 2, SEX, 2, MARITAL_STATUS, 2, GEOID, 2, EDUCATIONNUM, 2, OCCUPATION, 2, age, 3, REFID, 3, REF_DATE, 3, RESPONSE, 4, EVENTID, 4, REFID, 4, EVENT_DATE, 4, AMOUNT
Question: How many of the customers are male?
Evidence: SEX = 'Male';
SQL: SELECT COUNT(ID) FROM Customers WHERE SEX = 'Male'