question stringlengths 24 325 | sql stringlengths 30 804 | db_id stringclasses 63
values | prompt stringlengths 308 18.9k | question_id int64 167 9.43k | difficulty stringclasses 1
value |
|---|---|---|---|---|---|
How many stars did "Eagle Capital" received from Little Rock on 2013/4/4? | SELECT COUNT(T1.Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T2.city = 'Little Rock' AND T1.Date = '2013-04-04' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 267 | |
For the client who made the complaint call "CR0217298", what was his/her birthday? | SELECT T1.month, T1.day FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0217298' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 268 | |
What was the phone of number of the client who made the complaint call "CR0100432" ? | SELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0100432' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 269 | |
For all the complaint callers on 2017/3/27, what percentage of the clients are females? | 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 events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2017-03-27' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 270 | |
What is the percentage of the complaint calls from Mr Mason Javen Lopez has got the consent provided by the customer? | SELECT CAST(SUM(CASE WHEN T2.`Consumer consent provided?` = 'Consent provided' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Consumer consent provided?`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.first = 'Mason' AND T1.middle = 'Javen' AND T1.last = 'Lopez' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 271 | |
How many priority urgent complaints were received in march of 2017? List the complaint ID of these complaints. | SELECT COUNT(`Complaint ID`) FROM callcenterlogs WHERE `Date received` LIKE '2017-01%' AND priority = ( SELECT MAX(priority) FROM callcenterlogs ) | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 272 | |
Please list the full name, date of birth, and email id of the elderly clients in descending order of age. | SELECT first, middle, last, year, month , day, email FROM client WHERE age > 65 ORDER BY age DESC | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 273 | |
Which product got the most five stars, and how many? | SELECT T.Product, MAX(T.num) FROM ( SELECT Product, COUNT(Stars) AS num FROM reviews WHERE Stars = 5 GROUP BY Product ) T | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 274 | |
List all the states in the South region. | SELECT state FROM state WHERE Region = 'South' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 275 | |
What is the email id of clients whose calls were hung? | SELECT T1.email FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.outcome = 'HANG' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 276 | |
Calculate the average age of clients from the Midwest region. | SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T3.Region) AS average 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 277 | |
List the full name and phone number of clients who submitted the complaint via fax. | SELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Fax' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 278 | |
Find and list the names of districts which has below-average stars for Eagle Capital. | SELECT T2.division FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T1.Stars > ( SELECT AVG(Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id ) | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 279 | |
In the calls from the mountain division, how many are from teenage clients? | SELECT COUNT(T1.age) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.age BETWEEN 12 AND 20 AND T2.division = 'Mountain' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 280 | |
What is the number of complaints related to Credit cards came from female clients? | SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Female' AND T2.Product = 'Credit card' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 281 | |
Among the clients born between 1980 and 2000, list the name of male clients who complained through referral. | SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 282 | |
What is the medium through which most complaints are registered in Florida? | SELECT T3.`Submitted via` FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.state = 'FL' GROUP BY T1.`Complaint ID` ORDER BY COUNT(T1.`Complaint ID`) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 283 | |
Calculate the average number of complaints received from New Bedford each year which are closed with explanation. | SELECT STRFTIME('%Y', T3.`Date received`) , CAST(SUM(CASE WHEN T3.`Company response to consumer` = 'Closed with explanation' THEN 1 ELSE 0 END) AS REAL) / COUNT(T3.`Complaint ID`) AS average FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID`... | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 284 | |
What percentage of consumers from Houston disputed complaints? | SELECT CAST(SUM(CASE WHEN T2.`Consumer disputed?` = 'Yes' AND T1.city = 'Houston' 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 285 | |
Find the number of service members who complained in Syracuse. | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Tags = 'Servicemember' AND T1.city = 'Syracuse' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 286 | |
Among the calls from California, what percentage are priority 1? | SELECT CAST(SUM(CASE WHEN T1.priority = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.priority) FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id INNER JOIN state AS T4 ON T3.state_abbrev = T4.StateCode WHERE T4.State = 'Ca... | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 287 | |
Calculate the difference in the average age of elderly and middle-aged clients in the Northeast region. | SELECT (CAST(SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.age > 65 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END)) AS difference FROM client AS T1 INNER JOIN district AS T2 O... | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 288 | |
List by their ID number the 3 longest complaints. | SELECT `Complaint ID` FROM callcenterlogs ORDER BY ser_time DESC LIMIT 3 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 289 | |
How many clients have an email account other than gmail.com? | SELECT COUNT(email) FROM client WHERE email NOT LIKE '%@gmail.com' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 290 | |
Identify by their ID all clients who did not give their consent permission. | SELECT Client_ID FROM events WHERE `Consumer consent provided?` = 'N/A' OR 'Consumer consent provided?' IS NULL OR 'Consumer consent provided?' = '' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 291 | |
List by their ID the complaints received by the company on 25/09/2014 that took the longest. | SELECT `Complaint ID` FROM events WHERE strftime('%J', `Date sent to company`) - strftime('%J', `Date received`) = ( SELECT MAX(strftime('%J', `Date sent to company`) - strftime('%J', `Date received`)) FROM events WHERE `Date sent to company` = '2014-09-25' ) AND `Date sent to company` = '2014-09-25' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 292 | |
List priority 2 complaints by date received. | SELECT DISTINCT `Complaint ID` FROM callcenterlogs WHERE priority = 2 ORDER BY `Date received` DESC | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 293 | |
How many complaints are not in process with an agent? | SELECT COUNT(outcome) FROM callcenterlogs WHERE outcome != 'AGENT' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 294 | |
How many Credit Card complaints did Sharon handle? | SELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.Product = 'Credit card' AND T1.server = 'SHARON' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 295 | |
In which region have the most 1-star reviews been done? | SELECT T3.Region FROM reviews 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.Stars = 1 GROUP BY T3.Region ORDER BY COUNT(T3.Region) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 296 | |
In what years were the clients who demanded more problems with Certificate of deposit born? | SELECT T1.year FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Sub-product` = '(CD) Certificate of deposit' GROUP BY T1.year ORDER BY COUNT(T1.year) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 297 | |
How many cases of billing dispute issues occurred in the Mountain division? | SELECT COUNT(T1.Issue) FROM events AS T1 INNER JOIN client AS T2 ON T1.Client_ID = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id WHERE T1.Issue = 'Billing disputes' AND T3.division = 'Mountain' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 298 | |
How many male clients are from the state of Massachusetts? | SELECT COUNT(T3.sex) FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T1.state = 'Massachusetts' AND T3.sex = 'Male' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 299 | |
Lists the last name of all clients who made a PS-type complaint and were served by TOVA. | SELECT t1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'PS' AND T2.server = 'TOVA' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 300 | |
How many clients under the age of 35 gave Eagle National Mortgage 1 star? | SELECT COUNT(T2.age) FROM reviews AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle National Mortgage' AND T1.Stars = 1 AND T2.age < 35 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 301 | |
How many male clients born in the year 1977 were given priority 0 in their complaints? | SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Male' AND T2.priority = 0 AND T1.year = 1997 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 302 | |
List by name all customers who provided consent for the tag Older American. | 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.Tags = 'Older American' AND T2.`Consumer consent provided?` != 'N/A' AND T2.`Consumer consent provided?` IS NOT NULL AND T2.`Consumer consent provided?` != '' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 303 | |
What is the name of the state in which there have been the largest number of complaints with priority 0? | SELECT T2.state FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id INNER JOIN state AS T4 ON T3.state_abbrev = T4.StateCode WHERE T1.priority = 0 GROUP BY T2.state ORDER BY COUNT(T2.state) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 304 | |
How many complaints made by women and served after 3 pm received a timely response from the company? | SELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.sex = 'Female' AND T1.ser_start BETWEEN '15:00:01' AND '23:59:59' AND T3.`Timely response?` = 'Yes' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 305 | |
How many complaints were served in 5 minutes or less by DORIT and responded to the customer with an explanation, were made by phone? | SELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.ser_time < '00:05:00' AND T1.server = 'DORIT' AND T2.`Submitted via` = 'Phone' AND T2.`Company response to consumer` = 'Closed with explanation' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 306 | |
How many clients with the last name Alvarado are from Maryland? | SELECT COUNT(T2.client_id) FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T1.state_abbrev = T3.StateCode WHERE T2.last = 'Alvarado' AND T2.state = 'MD' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 307 | |
How many reviews by people between 30 and 50 years include the word 'great'? | SELECT COUNT(T1.Reviews) FROM reviews AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T2.age BETWEEN 30 AND 50 AND T1.Reviews LIKE '%great%' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 308 | |
What is the full address of the customers who, having received a timely response from the company, have dispute about that response? | SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'Yes' AND T2.`Consumer disputed?` = 'Yes' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 309 | |
How many complaints from female clients born in the year 2000 were not sent through the web? | SELECT COUNT(T2.`Submitted via`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Female' AND T1.year = 2000 AND T2.`Submitted via` != 'Web' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 310 | |
List all the complaints narratives made by the customer named Brenda and last name Mayer. | SELECT T2.`Consumer complaint narrative` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Brenda' AND T1.last = 'Mayer' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 311 | |
How many complaints from customers with a gmail.com email were received by the company in February 2017? | SELECT COUNT(T1.email) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE (T2.`Date received` LIKE '2017-02%' OR T2.`Date received` LIKE '2017-01%') AND T1.email LIKE '%@gmail.com' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 312 | |
What is the average number of stars given by Oregon clients in their reviews? | SELECT CAST(SUM(T3.Stars) AS REAL) / COUNT(T3.Stars) AS average 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.State = 'Oregon' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 313 | |
What percentage of clients who sent their complaints by postal mail are age 50 and older? | SELECT CAST(SUM(CASE WHEN T1.age > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Submitted via`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 314 | |
What is the average age of Norwalk clients? | SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T1.age) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Norwalk' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 315 | |
How many clients who live in Kansas City provided a 1-star review? | SELECT COUNT(T1.Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Kansas City' AND T1.Stars = 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 316 | |
Which state has the highest number of clients who gave a 5-star review? | SELECT T2.state_abbrev FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 GROUP BY T2.state_abbrev ORDER BY COUNT(T2.state_abbrev) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 317 | |
Which region does Noah Thompson live in? | SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.first = 'Noah' AND T1.last = 'Thompson' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 318 | |
How did Kyran Muller submit his complaint? | SELECT DISTINCT T2.`Submitted via` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kyran' AND T1.last = 'Muller' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 319 | |
What are the products that people who were born after 2005 complain about? | SELECT DISTINCT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year > 2005 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 320 | |
How long was Kendall Allen's complaint about her credit card? | SELECT T3.ser_time FROM events AS T1 INNER JOIN client AS T2 ON T1.Client_ID = T2.client_id INNER JOIN callcenterlogs AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.first = 'Kendall' AND T2.last = 'Allen' AND T2.sex = 'Female' AND T1.Product = 'Credit card' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 321 | |
What was the issue that the client with the longest server time faced? | SELECT T2.Issue FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.ser_time = ( SELECT MAX(ser_time) FROM callcenterlogs ) | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 322 | |
How many clients who live in New York City submitted their complaints via fax? | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City' AND T2.`Submitted via` = 'Fax' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 323 | |
What is the percentage of male clients complaining about their credit cards? | SELECT CAST(SUM(CASE WHEN T1.sex = 'Male' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 324 | |
Please list any two clients with their full names who have been tagged as "Older American" by the company without seeking their permission. | 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.Tags = 'Older American' AND T2.`Consumer consent provided?` IN (NULL, 'N/A', '') LIMIT 2 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 325 | |
What is the birth date of the youngest client? | SELECT day, month, year FROM client ORDER BY year DESC, month DESC, day DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 326 | |
How many times does the consumer have no dispute over a non-timely response from the company? | SELECT COUNT(`Timely response?`) FROM events WHERE `Timely response?` = 'No' AND `Consumer disputed?` = 'No' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 327 | |
How many of the complaints are longer than 15 minutes? | SELECT COUNT(ser_time) FROM callcenterlogs WHERE strftime('%M', ser_time) > '15' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 328 | |
What is the most common issue for the highest priority complaints? | SELECT T1.Issue FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.priority = 2 GROUP BY T1.Issue ORDER BY COUNT(T1.Issue) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 329 | |
List the full names of all clients who live in the Pacific division. | SELECT T2.first, T2.middle, T2.last FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.division = 'Pacific' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 330 | |
What is the social number of the person who made the most complaints? | SELECT T1.social FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID GROUP BY T1.client_id ORDER BY COUNT(T1.client_id) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 331 | |
Which is the city where most of the 1 star reviews come from? | SELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 1 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 332 | |
What is the address of the client who made a complaint via postal mail on March 14, 2012? | SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-03-14' AND T2.`Submitted via` = 'Postal mail' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 333 | |
Among the female clients, how many of them have a complaint with a priority of 1? | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Female' AND T2.priority = 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 334 | |
List all the server of the phone complaints with a late response from the company. | SELECT DISTINCT T2.server FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.`Submitted via` = 'Phone' AND T1.`Timely response?` = 'No' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 335 | |
List all the issues of the complaints made by Kaitlyn Eliza Elliott. | SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kaitlyn' AND T1.middle = 'Eliza' AND T1.last = 'Elliott' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 336 | |
What is the name of the state that the client with the email "skylar.ramirez@gmail.com" lives in? | SELECT T3.state FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T3.email = 'skylar.ramirez@gmail.com' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 337 | |
Which region has the second most clients? | SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division ORDER BY COUNT(T2.division) DESC LIMIT 1, 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 338 | |
Who is the owner of the final phone number for the complaints on server "MORIAH" on 9/11/2013? | 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.server = 'MORIAH' AND T2.`Date received` = '2013-09-11' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 339 | |
Compute the average time in minute for each age group | SELECT CAST(SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 60 * strftime('%H', ser_time) + strftime('%M', ser_time) + strftime('%S', ser_time) / 60 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END) AS teenagerAverageMins, CAST(SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 60 * strf... | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 340 | |
What percentage of complaints are from the elderly? | SELECT CAST(SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.age) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 341 | |
Calculate the percentage of male clients from Indianapolis City. | SELECT CAST(SUM(CASE WHEN sex = 'Male' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(client_id) FROM client WHERE city = 'Indianapolis' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 342 | |
Among the teenager clients who use Google account and Microsoft account, which group of client is more than the other? | SELECT CASE WHEN SUM(CASE WHEN email LIKE '%@gmail.com' THEN 1 ELSE 0 END) > SUM(CASE WHEN email LIKE '%@outlook.com' THEN 1 ELSE 0 END) THEN 'Google account' ELSE 'Microsoft account' END FROM client WHERE age BETWEEN 13 AND 19 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 343 | |
What is the full name of client whose email address is emily.garcia43@outlook.com? | SELECT first, middle, last FROM client WHERE email = 'emily.garcia43@outlook.com' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 344 | |
What is the first name of clients who have the highest priority? | SELECT T1.first FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = ( SELECT MAX(priority) FROM callcenterlogs ) | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 345 | |
List down the email of client whose complaint is type "PS". | SELECT T1.email FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'PS' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 346 | |
Among the elderlies, state the last name of whose complaint is handled in server YIFAT? | SELECT T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.age > 65 AND T2.server = 'YIFAT' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 347 | |
How many clients who live in New York City have the complaint outcome as "AGENT"? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 348 | |
List down the full name of clients who have disputed the response from company. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 349 | |
What are the complaint id of client who were born in 1931? | SELECT T2.`Complaint ID` FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.year = 1931 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 350 | |
Calculate the percentage of complaints made by Google account client in server ZOHARI. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 351 | |
State the full name of clients with server time of 20 minutes and above. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 352 | |
Pick 5 clients with 0 priority and write down their last name. | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 353 | |
Write down the call id of clients whose first name start with alphabet "B". | 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%' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 354 | |
What is the product complained by Alexander Bronx Lewis? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 355 | |
State the first name of male clients who did not receive timely response from the call center. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 356 | |
Which product received the most complaints from elder clients? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 357 | |
Complaint about Credit Card mostly came from clients of which age group? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 358 | |
List down the issues for complaint with server time of below 10 minutes. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 359 | |
Write down the date received of complaints sent via Fax. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 360 | |
What is the full name of clients who have issue about balance transfer? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 361 | |
What is the email address of clients who submitted their complaints via postal mail? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 362 | |
Calculate the average age of clients whose response is "Closed with relief". | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 363 | |
What is the average age of clients whose complaint type is "TT"? | SELECT AVG(T1.age) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'TT' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 364 | |
Write the complaint ID, call ID, and final phone number of complaints through AVIDAN server from 1/1/2014 to 12/30/2014. | SELECT `Complaint ID`, call_id, phonefinal FROM callcenterlogs WHERE strftime('%Y', `Date received`) = '2014' AND server = 'AVIDAN' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 365 | |
Between 1/1/2017 and 4/1/2017, what is the average server time of calls under the server DARMON? | SELECT AVG(CAST(SUBSTR(ser_time, 4, 2) AS REAL)) FROM callcenterlogs WHERE `Date received` BETWEEN '2017-01-01' AND '2017-04-01' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 366 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.