Chinastark/bird_dataset huggingface dataset:
Database: retail_complains
Question: How many clients who live in New York City have the complaint outcome as "AGENT"?
Evidence: New York City refers to city = 'New York City'
SQL: SELECT COUNT(T2.`rand client`) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.city = 'New York City' AND T2.outcome = 'AGENT'
Database: retail_complains
Question: List down the full name of clients who have disputed the response from company.
Evidence: full name refers to first, middle, last; disputed the response refers to Consumer disputed? = 'Yes'
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.`Consumer disputed?` = 'Yes'
Database: retail_complains
Question: What are the complaint id of client who were born in 1931?
Evidence: in 1931 refers to year = 1931
SQL: SELECT T2.`Complaint ID` FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.year = 1931
Database: retail_complains
Question: Calculate the percentage of complaints made by Google account client in server ZOHARI.
Evidence: Google account refers to email like '%@gmail.com'; percentage = divide(count(Complaint ID where email like '%@gmail.com') , count(Complaint ID)) * 100%
SQL: SELECT CAST(SUM(CASE WHEN T1.email LIKE '%@gmail.com' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.email) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.server = 'ZOHARI'
Database: retail_complains
Question: State the full name of clients with server time of 20 minutes and above.
Evidence: full name refers to first, middle, last; server time of 20 minutes and above refers to ser_time > '00:20:00'
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 strftime('%M', T2.ser_time) > '20'
Database: retail_complains
Question: Pick 5 clients with 0 priority and write down their last name.
Evidence: 0 priority refers to priority = 0; last name refers to last
SQL: SELECT T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = 0 LIMIT 5
Database: retail_complains
Question: Write down the call id of clients whose first name start with alphabet "B".
Evidence: first name start with alphabet "B" refers to first like 'B%'
SQL: SELECT T2.call_id FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.first LIKE 'B%'
Database: retail_complains
Question: What is the product complained by Alexander Bronx Lewis?
SQL: SELECT DISTINCT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Alexander' AND T1.middle = 'Bronx' AND T1.last = 'Lewis'
Database: retail_complains
Question: State the first name of male clients who did not receive timely response from the call center.
Evidence: first name refers to first; male refers to sex = 'Male'; did not receive timely response refers to Timely response? = 'No'
SQL: SELECT T1.first FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'No' AND T1.sex = 'Male'
Database: retail_complains
Question: Which product received the most complaints from elder clients?
Evidence: most complaints refers to max(client_id); elder client refers to age > 65
SQL: SELECT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age > 65 ORDER BY T1.client_id DESC LIMIT 1
Database: retail_complains
Question: Complaint about Credit Card mostly came from clients of which age group?
Evidence: about Credit Card refers to Product = 'Credit Card'; teenager refers to 13 < age < = 19; adult refers to 19 < age < = 65; elder refers to age < = 65
SQL: SELECT SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END), SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 1 ELSE 0 END) AS adult , SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS elder FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card'
Database: retail_complains
Question: List down the issues for complaint with server time of below 10 minutes.
Evidence: server time of below 10 minutes refers to ser_time < '00:10:00'
SQL: SELECT T2.Issue FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%M', T1.ser_time) < '10'
Database: retail_complains
Question: Write down the date received of complaints sent via Fax.
Evidence: sent via Fax refers to Submitted via = 'Fax'
SQL: SELECT T1.`Date received` FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Fax'
Database: retail_complains
Question: What is the full name of clients who have issue about balance transfer?
Evidence: full name refers to first, middle, last; issue about balance transfer refers to Issue = 'Balance transfer'
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.Issue = 'Balance transfer'
Database: retail_complains
Question: What is the email address of clients who submitted their complaints via postal mail?
Evidence: via postal mail refers to Submitted via = 'Postal mail'
SQL: SELECT T1.email FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail'
Database: retail_complains
Question: Calculate the average age of clients whose response is "Closed with relief".
Evidence: average age = avg(age where Company response to consumer = 'Closed with relief'); response "Closed with relief" refers to Company response to consumer = 'Closed with relief'
SQL: SELECT AVG(T1.age) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'Closed with relief'
Database: retail_complains
Question: What is the average age of clients whose complaint type is "TT"?
Evidence: average age = avg(age where type = 'TT')
SQL: SELECT AVG(T1.age) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'TT'
Database: retail_complains
Question: Write the complaint ID, call ID, and final phone number of complaints through AVIDAN server from 1/1/2014 to 12/30/2014.
Evidence: final phone number refers to phonefinal; from 1/1/2014 to 12/30/2014 refers to Date received between '2014-01-01' and '2014-12-30'
SQL: SELECT `Complaint ID`, call_id, phonefinal FROM callcenterlogs WHERE strftime('%Y', `Date received`) = '2014' AND server = 'AVIDAN'
Database: retail_complains
Question: Between 1/1/2017 and 4/1/2017, what is the average server time of calls under the server DARMON?
Evidence: between 1/1/2017 and 4/1/2017 refers to Date received between '2017-01-01' and '2017-04-01'; average server time refers to avg(ser_time)
SQL: SELECT AVG(CAST(SUBSTR(ser_time, 4, 2) AS REAL)) FROM callcenterlogs WHERE `Date received` BETWEEN '2017-01-01' AND '2017-04-01'
Database: retail_complains
Question: How many times per year does a credit card customer complain about overlimit fees?
Evidence: credit card customer refers to product = 'Credit card'; about overlimit fees refers to issue = 'Overlimit fee'
SQL: SELECT strftime('%Y', `Date received`), COUNT(`Date received`) FROM events WHERE product = 'Credit card' AND issue = 'Overlimit fee' GROUP BY strftime('%Y', `Date received`) HAVING COUNT(`Date received`)
Database: retail_complains
Question: Among the clients in Middle Atlantic, how many are them are female and no more than 18 years old?
Evidence: in Middle Atlantic refers to division = 'Middle Atlantic'; female refers to sex = 'Female'; no more than 18 refers to age < 18
SQL: SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Middle Atlantic' AND T1.sex = 'Female' AND T1.age < 18
Database: retail_complains
Question: Give me the full birthdate, email and phone number of the youngest client in Indianapolis .
Evidence: full birthdate = year, month, day; youngest refers to max(year, month, day); in Indianapolis refers to city = 'Indianapolis'
SQL: SELECT T1.year, T1.month, T1.day, T1.email, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Indianapolis' ORDER BY T1.year DESC, T1.month DESC, T1.day DESC LIMIT 1
Database: retail_complains
Question: List the top five cities in terms of the number of 5-star ratings in 2016 reviews, in descending order.
Evidence: 5-star rating refers to Stars = 5; in 2016 refers to Date like '2016%'; most reviews refers to max(count(city))
SQL: SELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 AND T1.Date LIKE '2016%' ORDER BY T1.Date DESC LIMIT 5
Database: retail_complains
Question: What is the longest server time when the call is about the issue of arbitration?
Evidence: longest server time refers to max(ser_time)
SQL: SELECT MAX(T1.ser_time) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.issue = 'Arbitration'
Database: retail_complains
Question: Give me the social number and state of the client whose phone number is 100-121-8371.
Evidence: social number refers to social
SQL: SELECT T1.social, T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T1.phone = '100-121-8371'
Database: retail_complains
Question: List the full names and phone numbers of clients that were from the Pacific.
Evidence: full name refers to first, middle, last; the Pacific refers to division = 'Pacific'
SQL: SELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific'
Database: retail_complains
Question: What is the social number of the client who has the longest delay in his/her complaint? Calculate the days of delay and state the company's response to the consumer.
Evidence: social number refers to social; longest delay = max(subtract(Date sent to company, Date received)); days of delay = subtract(Date sent to company, Date received); company's response refers to 'Company response to consumer'
SQL: SELECT T1.social , 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`)), T2.`Company response to consumer` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID ORDER BY 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`)) DESC LIMIT 1
Database: retail_complains
Question: How many female clients are there older than 30?
Evidence: female refers to sex = 'Female'; older than 30 refers to age > 30
SQL: SELECT COUNT(sex) FROM client WHERE sex = 'Female' AND age > 30
Database: retail_complains
Question: Please list all first and last names of clients who live in New York city.
Evidence: New York City refers to city = 'New York City'
SQL: SELECT first, last FROM client WHERE city = 'New York City'
Database: retail_complains
Question: What is the oldest age of male clients?
Evidence: oldest age refers to max(age); male refers to sex = 'Male'
SQL: SELECT MAX(age) FROM client WHERE sex = 'Male'
Database: retail_complains
Question: Please calculate the number of clients by each division.
SQL: SELECT T2.division, COUNT(T2.division) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division
Database: retail_complains
Question: What is the percentage of female clients in the Middle Atlantic?
Evidence: female refers to sex = 'Female'; the Middle Atlantic refers to division = 'Middle Atlantic'; percentage = divide(count(client_id where sex = 'Female' and division = 'Middle Atlantic') , count(client_id where division = 'Middle Atlantic')) * 100%
SQL: SELECT CAST(SUM(CASE WHEN T1.sex = 'Female' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'South Atlantic'
Database: retail_complains
Question: What is the average age of clients in South Atlantic?
Evidence: in South Atlantic refers to division = 'South Atlantic'; average age refers to avg(age)
SQL: SELECT AVG(T1.age) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'South Atlantic'
Database: retail_complains
Question: Which city in the Midwest region has the least number of clients?
Evidence: least number of clients refers to min(count(client_id))
SQL: SELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest' GROUP BY T2.city ORDER BY COUNT(T2.city) LIMIT 1
Database: retail_complains
Question: How many customers in the Northeast use Microsoft email?
Evidence: the Northeast refers to Region = 'Northeast'; Microsoft email refers to email like '%@outlook.com'
SQL: SELECT COUNT(T1.email) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast' AND T1.email LIKE '%@outlook.com'
Database: retail_complains
Question: Which city in West North Central has the highest number of customers over the age of 60?
Evidence: in North Central refers to Region = 'North Central'; highest number of customers refers to max(count(client_id)); over the age of 60 refers to age > 60
SQL: SELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'West North Central' AND T1.age > 60 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1
Database: retail_complains
Question: What is the percentage of complaints about the late fee issue whose priority is 2 in 2017?
Evidence: percentage = divide(count(Complaint ID where priority = 2) , count(Complaint ID)) * 100%; in 2017 refers to year(Date received) = 2017
SQL: SELECT CAST(SUM(CASE WHEN T1.priority = 2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2017'
Database: retail_complains
Question: Which state has the most cities?
Evidence: state refers to state_abbrev; most cities refers to max(count(city))
SQL: SELECT state_abbrev FROM district GROUP BY state_abbrev ORDER BY COUNT(city) DESC LIMIT 1
Database: retail_complains
Question: Please give the first name and phone number of the client whose complaint id is CR0922485.
Evidence: first name refers to first
SQL: SELECT T1.first, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0922485'
Database: retail_complains
Question: Please list the emails of the clients whose complaint date received is 7/3/2014.
Evidence: 7/3/2014 refers to Date received = '2014-07-03'
SQL: SELECT T1.email FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2014-07-03'
Database: retail_complains
Question: In 2012, how many complaints about Credit card product came from clients in Omaha?
Evidence: in 2012 refers to Date received LIKE'2012%'; in Omaha refers to city = 'Omaha'
SQL: SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Omaha' AND strftime('%Y', T2.`Date received`) = '2012' AND T2.Product = 'Credit card'
Database: retail_complains
Question: From 2012 to 2015, how many complaints were submitted via email from female clients?
Evidence: from 2012 to 2015 refers to Date received BETWEEN 2012 AND 2015; submitted via email refers to Submitted via = 'Email'; female refers to sex = 'Female'
SQL: SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2012' AND '2015' AND T2.`Submitted via` = 'Email' AND T1.sex = 'Male'
Database: retail_complains
Question: Please list all clients' phone numbers and complaint IDs which are still in progress.
Evidence: in progress refers to Company response to consumer = 'In progress'
SQL: SELECT T1.phone, T2.`Complaint ID` 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
Question: In 2015, how many complaints about Billing disputes were sent by clients in Portland?
Evidence: in 2015 refers to Date received LIKE'2015%'; about Billing disputes refers to Issue = 'Billing disputes'; Portland refers to city = 'Portland'
SQL: SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Portland' AND T2.`Date received` LIKE '2015%' AND T2.Issue = 'Billing disputes'
Database: retail_complains
Question: In 2014, what is the percentage of complaints from consumers in Houston that the delay was over 5 days?
Evidence: in 2014 refers to Date received LIKE'2014%'; Houston refers to city = 'Houston'; delay over 5 days refers to subtract(Date sent to company, Date received) > 5; percentage = divide(count(Complaint ID where subtract(Date sent to company , Date received) > 5) , count(Complaint ID)) * 100%
SQL: SELECT CAST((SUM(CASE WHEN strftime('%J', T2.`Date sent to company`) - strftime('%J', T2.`Date received`) > 5 THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Houston' AND strftime('%Y', T2.`Date received`) = '2014'
Database: retail_complains
Question: In the complains received in 2012, how many of them are submitted through email?
Evidence: received in 2012 refers to Date received LIKE '2012%'; submitted through email refers to Submitted via = 'Email'
SQL: SELECT COUNT(`Submitted via`) FROM events WHERE strftime('%Y', `Date received`) = '2012' AND `Submitted via` = 'Email'
Database: retail_complains
Question: Give the client ID of the complaint received on April 16, 2014 and submitted through fax.
Evidence: April 16, 2014 refers to Date received = '2014-04-16'; submitted through fax refers to Submitted via = 'Fax'
SQL: SELECT T2.Client_ID FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Fax' AND T1.`Date received` = '2014-04-16'
Database: retail_complains
Question: List date of the review of the Eagle Capital from Indianapolis, Indiana.
Evidence: Eagle Capital refers to Product = 'Eagle Capital'; Indianapolis refers to city = 'Indianapolis'; Indiana refers to state_abbrev = 'IN'
SQL: SELECT T2.Date FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Product = 'Eagle Capital' AND T1.city = 'Indianapolis' AND T1.state_abbrev = 'IN'
Database: retail_complains
Question: Among the complaints received in year 2015, what is total number of complaints timely response and closed with an explanation?
Evidence: in year 2015 refers to Date received LIKE '2015%'; timely response refers to Timely response?" = 'Yes'; closed with an explanation refers to Company response to consumer = 'Closed with explanation'
SQL: SELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2015' AND T2.`Timely response?` = 'Yes' AND T2.`Company response to consumer` = 'Closed with explanation'
Database: retail_complains
Question: Among the female clients that age between 20 to 40, list the date when their complaints were received.
Evidence: female refers to sex = 'Female'
SQL: SELECT DISTINCT T3.`Date received` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID INNER JOIN callcenterlogs AS T3 ON T2.`Complaint ID` = T3.`Complaint ID` WHERE T1.age BETWEEN 20 AND 40 AND T1.sex = 'Female'
Database: retail_complains
Question: List the product reviewed with 1 star on March 14, 2016 from Newton, Massachusetts.
Evidence: 1 star refers to Stars = 1; on March 14, 2016 refers to Date = '2016-03-14'; Newton refers to city = 'Newton'; Massachusetts refers to state_abbrev = 'MA'
SQL: SELECT T2.Product FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Newton' AND T1.state_abbrev = 'MA' AND T2.Date = '2016-03-14' AND T2.Stars = 1
Database: retail_complains
Question: In reviews for the Eagle National Bank product, how many of the 5 star reviews where from Nashville, Tennessee?
Evidence: 5 star refers to Stars = 5; Nashville refers to city = 'Nashville'; Tennessee refers to state_abbrev = 'TN'
SQL: SELECT COUNT(T2.Stars) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Nashville' AND T1.state_abbrev = 'TN' AND T2.Product = 'Eagle National Mortgage' AND T2.Stars = 5
Database: retail_complains
Question: What are the issues of the complains of male clients and products from age 25 and below?
Evidence: male refers to sex = 'Male'; age 25 and below refers to age < 25
SQL: SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.age < 25
Database: retail_complains
Question: Among the reviews from midwest region, what are the products that received 1 star?
Evidence: 1 star refers to Stars = 1
SQL: SELECT DISTINCT T3.Product FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN reviews AS T3 ON T2.district_id = T3.district_id WHERE T1.Region = 'Midwest' AND T3.Stars = 1
Database: retail_complains
Question: List the products involved in the complaints received on March 2017 via TOVA server.
Evidence: on March 2017 refers to Date received LIKE '%03%' AND Date received LIKE '2017%'
SQL: SELECT DISTINCT T2.Product FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.server = 'TOVA' AND T2.`Date received` LIKE '2017-03%'
Database: retail_complains
Question: What is the division of the review of 5 stars received on December 17, 2017 for the product Eagle National Mortgage?
Evidence: 5 stars refers to Stars = 5; on December 17 2017 refers to Date = '2017-12-17'
SQL: SELECT T1.division FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 AND T2.Date = '2017-12-17' AND T2.Product = 'Eagle National Mortgage'
Database: retail_complains
Question: In complaints about the credit card product, list the phone number of the oldest client.
Evidence: oldest refers to max(age)
SQL: SELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card' ORDER BY T1.age DESC LIMIT 1
Database: retail_complains
Question: In complaints received in 2014, how many of them were submitted via call?
Evidence: in 2014 refers to Date received LIKE '2014%'; submitted via call refers to Submitted via = 'Phone'
SQL: SELECT COUNT(T2.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Phone' AND strftime('%Y', T1.`Date received`) = '2014'
Database: retail_complains
Question: List the product and its issues of the complains of clients with age greater than the 60% of average age of all clients.
Evidence: age greater than the 60% of average age refers to age > multiply(avg(age) , 0.6)
SQL: SELECT DISTINCT T2.Product, T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age * 100 > ( SELECT AVG(age) * 60 FROM client )