1sf/bird-sql-train-with-schema huggingface dataset:
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: What is the full name of the client whose complaint on 2017/3/27 was received by MICHAL?
Evidence: full names = first, middle, last; on 2017/3/27 refers to "Date received" = '2017-03-27'; MICHAL refers to server = 'MICHAL';
SQL: SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.`Date received` = '2017-03-27' AND T2.server = 'MICHAL'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: For how long did the complaint filed on 2017/3/27 by Rachel Hicks last?
Evidence: how long did the complaint filed last refers to ser_time; on 2017/3/27 refers to "Date received" = '2017-03-27';
SQL: SELECT T2.ser_time FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.first = 'Rachel' AND T1.last = 'Hicks' AND T2.`Date received` = '2017-03-27'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Among all the clients from the New York city, how many of them have filed a complaint on the issue of Deposits and withdrawals?
SQL: SELECT COUNT(T2.Issue) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Issue = 'Deposits and withdrawals' AND T1.city = 'New York City'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Please list the full names of all the clients whose complaints are still in progress.
Evidence: full name = first, middle, last; complaints are still in progress refers to "Company response to consumer" = 'In progress';
SQL: SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Among the clients who did receive a timely response for their complaint, how many of them are from New York?
Evidence: did not receive a timely response refers to "Timely response?" = 'No'; New York refers to city = 'New York';
SQL: SELECT COUNT(T1.city) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'No' AND T1.city = 'New York City'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: How many complaints on credit cards in the year 2016 were filed by male clients?
Evidence: credit cards refers to Product = 'Credit card'; 2016 refers to year(Date received) = 2016; male refers to sex = 'Male';
SQL: SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) = '2016' AND T1.sex = 'Male' AND T2.Product = 'Credit card'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Which division is Diesel Galloway in?
SQL: SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.first = 'Diesel' AND T1.last = 'Galloway'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Please list the full names of all the male clients in the Pacific division.
Evidence: full names = first, middle, last; male refers to sex = 'Male';
SQL: SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific' AND T1.sex = 'Male'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: What is the average number of complaints on credit cards filed by clients from New York in the 3 consecutive years starting from 2015?
Evidence: average = AVG(Complaint ID); credit cards refers to Product = 'Credit card'; New York refers to city = 'New York'; 3 consecutive years starting from 2015 refers to "Date received" BETWEEN 2015 AND 2017;
SQL: SELECT CAST(COUNT(T2.`Complaint ID`) AS REAL) / 3 AS average FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2015' AND '2017' AND T1.city = 'New York City' AND T2.Product = 'Credit card'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: What is the percentage of the increase of complaints filed by the clients from New York from the year 2016 to the year 2017?
Evidence: percentage of increase = MULTIPLY(DIVIDE(SUBTRACT(SUM(year("Date received") = 2017), SUM(year("Date received") = 2016)), SUM(year("Date received") = 2016)), 1.0); New York refers to city = 'New York'; year("Date received") BETWEEN 2016 AND 2017;
SQL: SELECT 100.0 * (SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2017' THEN 1 ELSE 0 END) - SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END)) / SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: What was the serve time for the complaint call from client "C00007127" on 2017/2/22?
Evidence: serve time refers to ser_time; longer ser_time means more verbose or longer complaint; on 2017/2/22 refers to "Date received" = '2017-02-22';
SQL: SELECT T1.ser_time FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.Client_ID = 'C00007127' AND T1.`Date received` = '2017-02-22'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Which state does the owner of "wyatt.collins@gmail.com" live in? Give the full name of the state.
Evidence: full name of the state refers to state_name;
SQL: SELECT T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.email = 'wyatt.collins@gmail.com'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Which detailed product did Mr Lennox Oliver Drake complain about?
Evidence: detailed product refers to "Sub-product"; Mr refers to sex = 'Male';
SQL: SELECT DISTINCT T2.`Sub-product` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Lennox' AND T1.middle = 'Oliver' AND T1.last = 'Drake' AND T1.sex = 'Male'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: What was the detailed issue did Mr Gunner Omer Fuller complain about?
Evidence: detailed issue refers to Sub-issue; Mr refers to sex = 'Male';
SQL: SELECT T2.`Sub-issue` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Gunner' AND T1.middle = 'Omer' AND T1.last = 'Fuller' AND T1.sex = 'Male'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Did Ms. Lyric Emely Taylor provide the consent for result of the complaint call on 2016/5/20?
Evidence: Ms refers to sex = 'Female'; "Consumer consent provided?" in (null, 'N/A', 'Empty') means that the company didn't get the permission of consent; "Consumer consent provided?" not in (null, 'N/A', 'Empty') means the customers provide the consent; on 2016/5/20 refers to Date received = '2016-05-20';
SQL: SELECT CASE WHEN T2.`Consumer consent provided?` IN (NULL, 'N/A', '') THEN 'No' ELSE 'Yes' END FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Lyric' AND T1.middle = 'Emely' AND T1.last = 'Taylor' AND T1.sex = 'Female' AND T2.`Date received` = '2016-05-20'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?
Evidence: days delay for the complaint = SUBTRACT("date sent to company", "Date received"); Mr refers to sex = 'Male'; on 2012/5/18 refers to "Date received" = '2012-05-18';
SQL: SELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) AS days FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-05-18' AND T1.sex = 'Male' AND T1.first = 'Brantley' AND T1.middle = 'Julian' AND T1.last = 'Stanley'
Database: retail_complains
Tables: state, callcenterlogs, client, district, events, reviews
Columns (table index, column name): -1, *, 0, StateCode, 0, State, 0, Region, 1, Date received, 1, Complaint ID, 1, rand client, 1, phonefinal, 1, vru+line, 1, call_id, 1, priority, 1, type, 1, outcome, 1, server, 1, ser_start, 1, ser_exit, 1, ser_time, 2, client_id, 2, sex, 2, day, 2, month, 2, year, 2, age, 2, social, 2, first, 2, middle, 2, last, 2, phone, 2, email, 2, address_1, 2, address_2, 2, city, 2, state, 2, zipcode, 2, district_id, 3, district_id, 3, city, 3, state_abbrev, 3, division, 4, Date received, 4, Product, 4, Sub-product, 4, Issue, 4, Sub-issue, 4, Consumer complaint narrative, 4, Tags, 4, Consumer consent provided?, 4, Submitted via, 4, Date sent to company, 4, Company response to consumer, 4, Timely response?, 4, Consumer disputed?, 4, Complaint ID, 4, Client_ID, 5, Date, 5, Stars, 5, Reviews, 5, Product, 5, district_id
Question: Which district did the review on 2018/9/11 come from? Give the name of the city.
Evidence: on 2018/9/11 refers to Date = '2017-07-22';
SQL: SELECT T2.district_id, T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Date = '2018-09-11'