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: 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
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 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
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 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
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 reference ID with true response.
Evidence: reference ID refers to REFID;
SQL: SELECT REFID 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: 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
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 number of inhabitants less than 30.
Evidence: geographic identifier with an number of inhabitants less than 30 refers to GEOID where INHABITANTS_K < 30;
SQL: SELECT GEOID FROM Demog WHERE 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: In geographic identifier from 10 to 30, how many of them has an income below 2000?
Evidence: GEOID BETWEEN 10 AND 30; INCOME_K < 2000;
SQL: SELECT COUNT(GEOID) FROM Demog WHERE INCOME_K < 2000 AND GEOID >= 10 AND GEOID <= 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: What is the marital status of the customer ages 62 with an level of education of 7?
Evidence: customer ages 62 with an level of education of 7 refer age = 62 where EDUCATIONNUM = 7;
SQL: SELECT DISTINCT MARITAL_STATUS FROM Customers WHERE EDUCATIONNUM = 7 AND age = 62
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 widowed marital status and false response .
Evidence: number of inhabitants refers to INHABITANTS_K; RESPONSE = 'false';
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 T1.MARITAL_STATUS = 'Widowed' 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 response and number of inhabitants of the oldest female customer?
Evidence: number of inhabitants refers to INHABITANTS_K; oldest female customer refers to SEX = 'Female' where MAX(age);
SQL: SELECT T2.RESPONSE, T3.INHABITANTS_K 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 T1.SEX = 'Female' 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 female customers with an level of education of 3 and below, list their income.
Evidence: female customers with level of education of 3 and below refer to SEX = 'Female' where EDUCATIONNUM ≤ 3; income refers to INCOME_K;
SQL: SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 3 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: List the level of education and income of customers ages from 30 to 55 with a true response.
Evidence: ages from 30 to 55 refer to age BETWEEN 30 AND 55; RESPONSE = 'true'; income refers to INCOME_K; education level refers to EDUCATIONNUM;
SQL: SELECT T1.EDUCATIONNUM, T3.INCOME_K 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 T1.age >= 30 AND T1.age <= 55 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: In male customers ages from 30 to 50, how many of them has an income ranges from 2000 to 2300?
Evidence: male customers ages from 30 to 50 refer to SEX = 'Male' where age BETWEEN 30 AND 50; income ranges from 2000 to 2300 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.SEX = 'Male' AND T1.age >= 30 AND T1.age <= 50 AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 2300
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 educationnum and response of customers within the age of 20 to 30 that has the highest number of inhabitants among the group.
Evidence: age of 20 to 30 refers to age BETWEEN 20 AND 30; the highest number of inhabitants refers to MAX(INHABITANTS_K);
SQL: SELECT T1.EDUCATIONNUM, T2.RESPONSE 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 T1.age >= 20 AND T1.age <= 30 ORDER BY T3.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: What is the income of female customers ages from 30 to 55 years old and has an occupation of machine-op-inspct?
Evidence: female customers ages from 30 to 55 years old refer to SEX = 'Female' where age BETWEEN 30 AND 55; income refers to INCOME_K;
SQL: SELECT T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.age >= 30 AND T1.age <= 55 AND T1.OCCUPATION = 'Machine-op-inspct'
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 and response of female customers with an level of education of 8 and above.
Evidence: female customers with an level of education of 8 and above refer to SEX = 'Female' where EDUCATIONNUM ≥ 8;
SQL: SELECT DISTINCT T1.MARITAL_STATUS, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.EDUCATIONNUM > 8 AND T1.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: What is the age of female customers within the number of inhabitants below 30?
Evidence: female customers within the number of inhabitants below 30 refer to SEX = 'Female' where INHABITANTS_K < 30;
SQL: SELECT age FROM Customers WHERE GEOID IN ( SELECT GEOID FROM Demog WHERE INHABITANTS_K < 30 ) 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: Among the divorced male customers, give the income and response of those who has an level of education of 6 and above.
Evidence: divorced male customers refer to SEX = 'Male' where MARITAL_STATUS = 'Divorced';
SQL: SELECT DISTINCT T3.INCOME_K, T2.RESPONSE 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 T1.EDUCATIONNUM > 6 AND T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced'
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 and response of female customers within the number of inhabitants range of 20 to 25?
Evidence: female customers within the number of inhabitants range of 20 to 25 refer to SEX = 'Female' where INHABITANTS_K BETWEEN 20 AND 25;
SQL: SELECT DISTINCT T1.OCCUPATION, T2.RESPONSE 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 T1.SEX = 'Female' AND T3.INHABITANTS_K >= 20 AND T3.INHABITANTS_K <= 25
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 male customers with an occupation handlers or cleaners, what is the percentage of customers with a true response?
Evidence: DIVIDE(COUNT(OCCUPATION = 'Handlers-cleaners', SEX = 'Male' and RESPONSE = 'true'), COUNT(OCCUPATION = 'Handlers-cleaners' and SEX = 'Male')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.RESPONSE = 'true' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(T2.REFID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.OCCUPATION = 'Handlers-cleaners' 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: List the income and number of inhabitants of customers with a reference ID greater than the 50% of average of number of false response?
Evidence: reference ID greater than the 50% of average of number of false response refers to REFID > DIVIDE(MULTIPLY(0.5, COUNT(RESPONSE = 'false')), COUNT(RESPONSE)); income refers to INCOME_K; number of inhabitants refer 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 INNER JOIN Mailings1_2 AS T3 ON T1.ID = T3.REFID WHERE T3.REFID > ( SELECT 0.5 * COUNT(CASE WHEN RESPONSE = 'false' THEN 1 ELSE NULL END) / COUNT(RESPONSE) FROM Mailings1_2 )
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 ratio of male and female among the age of teenager when the education is above 10?
Evidence: ratio = DIVIDE(COUNT(SEX = 'Male' where age BETWEEN 13 AND 19 and EDUCATIONNUM > 10),COUNT(SEX = 'Female' where age BETWEEN 13 AND 19 and EDUCATIONNUM > 10));
SQL: SELECT CAST(SUM(CASE WHEN SEX = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN SEX = 'Female' THEN 1 ELSE 0 END) FROM Customers WHERE age BETWEEN 13 AND 19 AND EDUCATIONNUM > 10
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 ID and total income per year when the average income is above 3300 dollar.
Evidence: total income per year refers to MULTIPLY(12, INHABITANTS_K, INCOME_K) where INCOME_K > 3300; geographic ID refers to GEOID;
SQL: SELECT GEOID, INHABITANTS_K * INCOME_K * 12 FROM Demog WHERE INCOME_K > 3300
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: Point out the greater one between the number of actual responding and not responding to mailing.
Evidence: COUNT(REFID where RESPONSE = 'true')>or<COUNT(REFID where RESPONSE = 'false');
SQL: SELECT RESPONSE FROM Mailings1_2 GROUP BY RESPONSE ORDER BY COUNT(RESPONSE) 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: Find out the yearly income of geographic ID when the customer is female and occupation as sales.
Evidence: yearly income of geographic ID refers to GEOID where MULTIPLY(INHABITANTS_K, INCOME_K, 12); SEX = 'Female';
SQL: SELECT T2.INHABITANTS_K * T2.INCOME_K * 12 FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.OCCUPATION = 'Sales'