1sf/bird-sql-train-with-schema huggingface dataset:
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: 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
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 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
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: 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
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: 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
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 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
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: 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
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: 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
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 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
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 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
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: 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
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: 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
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 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
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 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
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: 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
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 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
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 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
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: 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
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: 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
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: 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
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: 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
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: 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
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: 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
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 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
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 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
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 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