db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
book_publishing_company | select t1.fname from employee as t1 inner join jobs as t2 on t1.job_id = t2.job_id where t2.job_desc = 'managing editor' | Question: please list the first names of the employees who work as managing editor. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_i... | please list the first names of the employees who work as managing editor. |
book_publishing_company | select t2.max_lvl from employee as t1 inner join jobs as t2 on t1.job_id = t2.job_id order by t1.hire_date limit 1 | Question: what is the highest level of job to get to for the employee who got hired the earliest? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit... | what is the highest level of job to get to for the employee who got hired the earliest? |
book_publishing_company | select t2.city from sales as t1 inner join stores as t2 on t1.stor_id = t2.stor_id group by t2.city order by sum(t1.qty) desc limit 1 | Question: in which city is the store with the highest total sales quantity located? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_i... | in which city is the store with the highest total sales quantity located? |
book_publishing_company | select t2.price from sales as t1 inner join titles as t2 on t1.title_id = t2.title_id order by t1.qty desc limit 1 | Question: what is the price of the book that sells the best? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hir... | what is the price of the book that sells the best? |
book_publishing_company | select t2.stor_name from sales as t1 inner join stores as t2 on t1.stor_id = t2.stor_id inner join titles as t3 on t1.title_id = t3.title_id where t3.title = 'life without fear' | Question: please list the stores that ordered the book 'life without fear'. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_l... | please list the stores that ordered the book 'life without fear'. |
book_publishing_company | select count(t1.stor_id) from sales as t1 inner join stores as t2 on t1.stor_id = t2.stor_id inner join titles as t3 on t1.title_id = t3.title_id where t2.state = 'massachusetts' | Question: among the stores that have ordered the book 'life without fear', how many of them are located in massachusetts? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee... | among the stores that have ordered the book 'life without fear', how many of them are located in massachusetts? |
book_publishing_company | select t2.country from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t1.title = 'life without fear' | Question: in which country is the publisher of the book 'life without fear' located? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_... | in which country is the publisher of the book 'life without fear' located? |
book_publishing_company | select t2.pub_name from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id order by t1.price desc limit 1 | Question: what is the publisher that has published the most expensive book? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_l... | what is the publisher that has published the most expensive book? |
book_publishing_company | select count(distinct t1.pub_id) from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t2.country = 'usa' and t1.price > 15 | Question: among the publishers in the usa, how many of them have published books that are over $15? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, min... | among the publishers in the usa, how many of them have published books that are over $15? |
book_publishing_company | select t1.notes from titles as t1 inner join sales as t2 on t1.title_id = t2.title_id order by t2.qty desc limit 3 | Question: please give more detailed information about the first three books that sell the best. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, ... | please give more detailed information about the first three books that sell the best. |
book_publishing_company | select sum(t1.qty) from sales as t1 inner join stores as t2 on t1.stor_id = t2.stor_id inner join titles as t3 on t1.title_id = t3.title_id where t2.state = 'massachusetts' and t3.type = 'business' | Question: how many books on business have the bookstores in massachusetts ordered? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id... | how many books on business have the bookstores in massachusetts ordered? |
book_publishing_company | select cast(sum(t2.qty) as real) / count(t1.title_id) from titles as t1 inner join sales as t2 on t1.title_id = t2.title_id where t1.title = 'life without fear' | Question: what is the average quantity of each order for the book 'life without fear'? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, jo... | what is the average quantity of each order for the book 'life without fear'? |
book_publishing_company | select avg(t2.job_lvl), t1.max_lvl - avg(t2.job_lvl) from jobs as t1 inner join employee as t2 on t1.job_id = t2.job_id where t1.job_desc = 'managing editor' group by t2.job_id, t1.max_lvl | Question: what is the average level employees working as managing editor are at? how many levels are there between the average level and the highest level? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_na... | what is the average level employees working as managing editor are at? how many levels are there between the average level and the highest level? |
book_publishing_company | select title from titles where type = 'business' order by price limit 1 | Question: which one is the cheapest business book? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_date. pu... | which one is the cheapest business book? |
book_publishing_company | select type from titles order by advance desc limit 1 | Question: which type of book had the most pre-paid amount? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_... | which type of book had the most pre-paid amount? |
book_publishing_company | select royalty from titles order by ytd_sales desc limit 1 | Question: what's the royalty for the bestseller book? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_date.... | what's the royalty for the bestseller book? |
book_publishing_company | select job_lvl from employee where lname = 'o''rourke' | Question: which job level is o'rourke at? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_date. pub_info ->... | which job level is o'rourke at? |
book_publishing_company | select emp_id from employee where minit = '' order by job_lvl desc limit 1 | Question: show me the employ id of the highest employee who doesn't have a middle name. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, j... | show me the employ id of the highest employee who doesn't have a middle name. |
book_publishing_company | select t1.contract from authors as t1 inner join titleauthor as t2 on t1.au_id = t2.au_id inner join titles as t3 on t2.title_id = t3.title_id where t3.title = 'sushi, anyone?' | Question: is the author of 'sushi, anyone?' on the contract? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hir... | is the author of 'sushi, anyone?' on the contract? |
book_publishing_company | select t1.fname, t1.minit, t1.lname from employee as t1 inner join jobs as t2 on t1.job_id = t2.job_id order by t1.job_lvl desc limit 1 | Question: which publisher had the highest job level? give his/her full name. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_... | which publisher had the highest job level? give his/her full name. |
book_publishing_company | select t2.job_desc from employee as t1 inner join jobs as t2 on t1.job_id = t2.job_id where t1.fname = 'pedro' and t1.minit = 's' and t1.lname = 'afonso' | Question: what's pedro s afonso's job title? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_date. pub_info... | what's pedro s afonso's job title? |
book_publishing_company | select t2.max_lvl - t1.job_lvl from employee as t1 inner join jobs as t2 on t1.job_id = t2.job_id where t1.fname = 'diego' and t1.minit = 'w' and t1.lname = 'roel' | Question: how many levels are there left for diego w roel to reach if he/she could go to the max level for his/her position? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. emplo... | how many levels are there left for diego w roel to reach if he/she could go to the max level for his/her position? |
book_publishing_company | select t1.notes from titles as t1 inner join sales as t2 on t1.title_id = t2.title_id where strftime('%y-%m-%d', t2.ord_date) = '1994-09-14' | Question: what's on the notes for the order happened on 1994/9/14? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_i... | what's on the notes for the order happened on 1994/9/14? |
book_publishing_company | select distinct t1.type from titles as t1 inner join sales as t2 on t1.title_id = t2.title_id where strftime('%y-%m-%d', t2.ord_date) = '1993-05-29' | Question: list the type of the book for the order which was sold on 1993/5/29. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, jo... | list the type of the book for the order which was sold on 1993/5/29. |
book_publishing_company | select t1.pr_info from pub_info as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t2.country = 'france' | Question: tell me about the information of the french publisher. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id,... | tell me about the information of the french publisher. |
book_publishing_company | select t2.pub_name from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t1.title = 'silicon valley gastronomic treats' | Question: what's the publisher of the book 'silicon valley gastronomic treats'? give the publisher's name. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fna... | what's the publisher of the book 'silicon valley gastronomic treats'? give the publisher's name. |
book_publishing_company | select t2.city from employee as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t1.fname = 'victoria' and t1.minit = 'p' and t1.lname = 'ashworth' | Question: which city did victoria p ashworth work in? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_date.... | which city did victoria p ashworth work in? |
book_publishing_company | select count(t1.ord_num) from sales as t1 inner join stores as t2 on t1.stor_id = t2.stor_id where t2.city = 'remulade' | Question: how many sales did the store in remulade make? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lname, job_id, job_lvl, pub_id, hire_da... | how many sales did the store in remulade make? |
book_publishing_company | select cast(sum(case when t2.city = 'fremont' then qty end) - sum(case when t2.city = 'portland' then qty end) as real) * 100 / sum(case when t2.city = 'fremont' then qty end) from sales as t1 inner join stores as t2 on t1.stor_id = t2.stor_id where strftime('%y', t1.ord_date) = '1993' | Question: for the quantities, what percent more did the store in fremont sell than the store in portland in 1993? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_... | for the quantities, what percent more did the store in fremont sell than the store in portland in 1993? |
book_publishing_company | select cast(sum(case when t2.job_desc = 'publisher' then 1 else 0 end) - sum(case when t2.job_desc = 'designer' then 1 else 0 end) as real) * 100 / count(t1.job_id) from employee as t1 inner join jobs as t2 on t1.job_id = t2.job_id | Question: among all the employees, how many percent more for the publishers than designers? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, lnam... | among all the employees, how many percent more for the publishers than designers? |
book_publishing_company | select fname, minit, lname from employee where strftime('%y', hire_date) between '1990' and '1995' order by job_lvl desc | Question: find and list the full name of employees who were hired between 1990 and 1995. also, arrange them in the descending order of job level. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, ... | find and list the full name of employees who were hired between 1990 and 1995. also, arrange them in the descending order of job level. |
book_publishing_company | select distinct t1.title, t1.type, t1.price from titles as t1 inner join roysched as t2 on t1.title_id = t2.title_id where t2.royalty > ( select cast(sum(royalty) as real) / count(title_id) from roysched ) | Question: which titles has above average royalty rate? give those title's name, type and price? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fname, minit, ... | which titles has above average royalty rate? give those title's name, type and price? |
book_publishing_company | select distinct t1.title, t1.type, t1.price from titles as t1 inner join sales as t2 on t1.title_id = t2.title_id where t2.ord_date like '1994%' and t2.qty < ( select cast(sum(t4.qty) as real) / count(t3.title_id) from titles as t3 inner join sales as t4 on t3.title_id = t4.title_id ) | Question: in 1994 which title had less order quanty than the average order quantity? find the title name, type and price. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee... | in 1994 which title had less order quanty than the average order quantity? find the title name, type and price. |
book_publishing_company | select t1.title, t1.type, t1.price from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t2.pub_name = 'new moon books' order by t1.price | Question: list the title name, type, and price of the titles published by new moon books. arrange the list in ascending order of price. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, cou... | list the title name, type, and price of the titles published by new moon books. arrange the list in ascending order of price. |
book_publishing_company | select t1.title from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id inner join roysched as t3 on t1.title_id = t3.title_id where t2.country = 'usa' order by t1.royalty desc | Question: in the books published by us publishers, which book has the highest royalty? list these books in the descending order of royalty. | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state,... | in the books published by us publishers, which book has the highest royalty? list these books in the descending order of royalty. |
book_publishing_company | select (cast(sum(case when t2.country = 'usa' then t1.royalty else 0 end) as real) / sum(case when t2.country = 'usa' then 1 else 0 end)) - (cast(sum(case when t2.country != 'usa' then t1.royalty else 0 end) as real) / sum(case when t2.country != 'usa' then 1 else 0 end)) from titles as t1 inner join publishers as t2 o... | Question: find the difference between the average royalty of titles published by us and non us publishers? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> emp_id, fna... | find the difference between the average royalty of titles published by us and non us publishers? |
book_publishing_company | select (cast(sum(case when t1.country = 'usa' then job_lvl else 0 end) as real) / sum(case when t1.country = 'usa' then 1 else 0 end)) - (cast(sum(case when t1.country != 'usa' then job_lvl else 0 end) as real) / sum(case when t1.country != 'usa' then 1 else 0 end)) from publishers as t1 inner join employee as t2 on t1... | Question: calculate the average level difference between the marketing editors hired by the us and non-us publishers? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, state, country. employee -> ... | calculate the average level difference between the marketing editors hired by the us and non-us publishers? |
book_publishing_company | select t1.title, t2.pub_name, t1.price from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t1.notes = 'helpful hints on how to use your electronic resources to the best advantage.' | Question: which title is about helpful hints on how to use your electronic resources, which publisher published it and what is the price of this book? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, c... | which title is about helpful hints on how to use your electronic resources, which publisher published it and what is the price of this book? |
book_publishing_company | select t1.title, t2.pub_name, t1.ytd_sales from titles as t1 inner join publishers as t2 on t1.pub_id = t2.pub_id where t1.notes = 'carefully researched study of the effects of strong emotions on the body. metabolic charts included.' | Question: of the titles, which title is about the carefully researched study of the effects of strong emotions on the body, which state-based publisher published this book, and what is the year-to-date sale? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_... | of the titles, which title is about the carefully researched study of the effects of strong emotions on the body, which state-based publisher published this book, and what is the year-to-date sale? |
book_publishing_company | select t1.title from titles as t1 inner join sales as t2 on t1.title_id = t2.title_id inner join publishers as t3 on t1.pub_id = t3.pub_id where t2.qty > ( select cast(sum(qty) as real) / count(title_id) from sales ) and t3.state = 'ca' order by t2.qty desc limit 5 | Question: name the top five titles that sold more than average and list them in descending order of the number of sales in california stores? | Tables: authors -> au_id, au_lname, au_fname, phone, address, city, state, zip, contract. jobs -> job_id, job_desc, min_lvl, max_lvl. publishers -> pub_id, pub_name, city, stat... | name the top five titles that sold more than average and list them in descending order of the number of sales in california stores? |
retail_complains | select `date received` from callcenterlogs where ser_time = ( select max(ser_time) from callcenterlogs ) | Question: on which day was the most verbose complaint received? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social,... | on which day was the most verbose complaint received? |
retail_complains | select min(ser_time) from callcenterlogs where `date received` = '2017-03-22' | Question: when did the earliest complaint start on 2017/3/22? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, f... | when did the earliest complaint start on 2017/3/22? |
retail_complains | select case when sum(case when `complaint id` = 'cr2400594' then priority end) > sum(case when `complaint id` = 'cr2405641' then priority end) then 'cr2400594' else 'cr2405641' end from callcenterlogs | Question: which complaint is more urgent, complaint id cr2400594 or id cr2405641? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, ... | which complaint is more urgent, complaint id cr2400594 or id cr2405641? |
retail_complains | select first, middle, last from client where year > 1990 | Question: please list the full names of all the male clients born after the year 1990. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, mo... | please list the full names of all the male clients born after the year 1990. |
retail_complains | select count(t1.client_id) from client as t1 inner join events as t2 on t1.client_id = t2.client_id where t1.first = 'diesel' and t1.last = 'galloway' | Question: how many complaints have the client diesel galloway filed? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, so... | how many complaints have the client diesel galloway filed? |
retail_complains | select t2.`sub-product` from client as t1 inner join events as t2 on t1.client_id = t2.client_id where t1.first = 'diesel' and t1.last = 'galloway' and t2.`date received` = '2014-07-03' | Question: what is the detailed product of the complaint filed by diesel galloway on 2014/7/3? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, ... | what is the detailed product of the complaint filed by diesel galloway on 2014/7/3? |
retail_complains | select case when t2.`consumer consent provided?` in (null, 'n/a', 'empty') then 'no' else 'yes' end from client as t1 inner join events as t2 on t1.client_id = t2.client_id where t1.first = 'matthew' and t1.last = 'pierce' and t2.`date received` = '2016-10-28' | Question: was the tag in the complaint filed by matthew pierce on 2016/10/28 approved by himself? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, s... | was the tag in the complaint filed by matthew pierce on 2016/10/28 approved by himself? |
retail_complains | 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`)) from client as t1 inner join events as t2 on t1.client_... | Question: for how long was the complaint filed by matthew pierce on 2016/10/28 delayed? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, m... | for how long was the complaint filed by matthew pierce on 2016/10/28 delayed? |
retail_complains | 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' | Question: what is the full name of the client whose complaint on 2017/3/27 was received by michal? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, ... | what is the full name of the client whose complaint on 2017/3/27 was received by michal? |
retail_complains | 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' | Question: for how long did the complaint filed on 2017/3/27 by rachel hicks last? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, ... | for how long did the complaint filed on 2017/3/27 by rachel hicks last? |
retail_complains | 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' | 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? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, se... | among all the clients from the new york city, how many of them have filed a complaint on the issue of deposits and withdrawals? |
retail_complains | 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' | Question: please list the full names of all the clients whose complaints are still in progress. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex... | please list the full names of all the clients whose complaints are still in progress. |
retail_complains | 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' | Question: among the clients who did receive a timely response for their complaint, how many of them are from new york? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. c... | among the clients who did receive a timely response for their complaint, how many of them are from new york? |
retail_complains | 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' | Question: how many complaints on credit cards in the year 2016 were filed by male clients? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day... | how many complaints on credit cards in the year 2016 were filed by male clients? |
retail_complains | 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' | Question: which division is diesel galloway in? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, first, middle, ... | which division is diesel galloway in? |
retail_complains | 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' | Question: please list the full names of all the male clients in the pacific division. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, mon... | please list the full names of all the male clients in the pacific division. |
retail_complains | 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' | 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? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_st... | what is the average number of complaints on credit cards filed by clients from new york in the 3 consecutive years starting from 2015? |
retail_complains | 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.clien... | 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? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_e... | what is the percentage of the increase of complaints filed by the clients from new york from the year 2016 to the year 2017? |
retail_complains | 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' | Question: what was the serve time for the complaint call from client 'c00007127' on 2017/2/22? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex,... | what was the serve time for the complaint call from client 'c00007127' on 2017/2/22? |
retail_complains | 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' | Question: which state does the owner of 'wyatt.collins@gmail.com' live in? give the full name of the state. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> cl... | which state does the owner of 'wyatt.collins@gmail.com' live in? give the full name of the state. |
retail_complains | 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' | Question: which detailed product did mr lennox oliver drake complain about? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, ... | which detailed product did mr lennox oliver drake complain about? |
retail_complains | 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' | Question: what was the detailed issue did mr gunner omer fuller complain about? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, ye... | what was the detailed issue did mr gunner omer fuller complain about? |
retail_complains | 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' | Question: did ms. lyric emely taylor provide the consent for result of the complaint call on 2016/5/20? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client... | did ms. lyric emely taylor provide the consent for result of the complaint call on 2016/5/20? |
retail_complains | 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... | Question: how many days delay for the complaint call from mr. brantley julian stanley on 2012/5/18? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id,... | how many days delay for the complaint call from mr. brantley julian stanley on 2012/5/18? |
retail_complains | 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' | Question: which district did the review on 2018/9/11 come from? give the name of the city. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day... | which district did the review on 2018/9/11 come from? give the name of the city. |
retail_complains | select t1.reviews from reviews as t1 inner join district as t2 on t1.district_id = t2.district_id where t2.city = 'jacksonville' and t1.date = '2017-07-22' | Question: what was the review context from jacksonville on 2017/7/22? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, s... | what was the review context from jacksonville on 2017/7/22? |
retail_complains | select t1.product from reviews as t1 inner join district as t2 on t1.district_id = t2.district_id where t2.city = 'indianapolis' and t1.date = '2016-10-07' | Question: which product received a review from indianapolis on 2016/10/7? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, ag... | which product received a review from indianapolis on 2016/10/7? |
retail_complains | 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' | Question: how many stars did 'eagle capital' received from little rock on 2013/4/4? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month... | how many stars did 'eagle capital' received from little rock on 2013/4/4? |
retail_complains | 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' | Question: for the client who made the complaint call 'cr0217298', what was his/her birthday | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, da... | for the client who made the complaint call 'cr0217298', what was his/her birthday |
retail_complains | select t1.phone from client as t1 inner join events as t2 on t1.client_id = t2.client_id where t2.`complaint id` = 'cr0100432' | Question: what was the phone of number of the client who made the complaint call 'cr0100432' | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, d... | what was the phone of number of the client who made the complaint call 'cr0100432' |
retail_complains | 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' | Question: for all the complaint callers on 2017/3/27, what percentage of the clients are females? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, s... | for all the complaint callers on 2017/3/27, what percentage of the clients are females? |
retail_complains | 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' | Question: what is the percentage of the complaint calls from mr mason javen lopez has got the consent provided by the customer? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, se... | what is the percentage of the complaint calls from mr mason javen lopez has got the consent provided by the customer? |
retail_complains | select count(`complaint id`) from callcenterlogs where `date received` like '2017-01%' and priority = ( select max(priority) from callcenterlogs ) | Question: how many priority urgent complaints were received in march of 2017? list the complaint id of these complaints. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time.... | how many priority urgent complaints were received in march of 2017? list the complaint id of these complaints. |
retail_complains | select first, middle, last, year, month , day, email from client where age > 65 order by age desc | Question: please list the full name, date of birth, and email id of the elderly clients in descending order of age. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. clie... | please list the full name, date of birth, and email id of the elderly clients in descending order of age. |
retail_complains | select t.product, max(t.num) from ( select product, count(stars) as num from reviews where stars = 5 group by product ) t | Question: which product got the most five stars, and how many? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, ... | which product got the most five stars, and how many? |
retail_complains | select state from state where region = 'south' | Question: list all the states in the south region. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, first, middl... | list all the states in the south region. |
retail_complains | select t1.email from client as t1 inner join callcenterlogs as t2 on t1.client_id = t2.`rand client` where t2.outcome = 'hang' | Question: what is the email id of clients whose calls were hung? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social... | what is the email id of clients whose calls were hung? |
retail_complains | 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' | Question: calculate the average age of clients from the midwest region. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age,... | calculate the average age of clients from the midwest region. |
retail_complains | 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' | Question: list the full name and phone number of clients who submitted the complaint via fax. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, ... | list the full name and phone number of clients who submitted the complaint via fax. |
retail_complains | 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 ) | Question: find and list the names of districts which has below-average stars for eagle capital. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex... | find and list the names of districts which has below-average stars for eagle capital. |
retail_complains | 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' | Question: in the calls from the mountain division, how many are from teenage clients? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, mon... | in the calls from the mountain division, how many are from teenage clients? |
retail_complains | 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' | Question: what is the number of complaints related to credit cards came from female clients? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, d... | what is the number of complaints related to credit cards came from female clients? |
retail_complains | 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' | Question: among the clients born between 1980 and 2000, list the name of male clients who complained through referral. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. c... | among the clients born between 1980 and 2000, list the name of male clients who complained through referral. |
retail_complains | 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 | Question: what is the medium through which most complaints are registered in florida? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, mon... | what is the medium through which most complaints are registered in florida? |
retail_complains | 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`... | Question: calculate the average number of complaints received from new bedford each year which are closed with explanation. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_ti... | calculate the average number of complaints received from new bedford each year which are closed with explanation. |
retail_complains | 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 | Question: what percentage of consumers from houston disputed complaints? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age... | what percentage of consumers from houston disputed complaints? |
retail_complains | 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' | Question: find the number of service members who complained in syracuse. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age... | find the number of service members who complained in syracuse. |
retail_complains | 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... | Question: among the calls from california, what percentage are priority 1? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, a... | among the calls from california, what percentage are priority 1? |
retail_complains | 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... | Question: calculate the difference in the average age of elderly and middle-aged clients in the northeast region. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client... | calculate the difference in the average age of elderly and middle-aged clients in the northeast region. |
retail_complains | select `complaint id` from callcenterlogs order by ser_time desc limit 3 | Question: list by their id number the 3 longest complaints. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, fir... | list by their id number the 3 longest complaints. |
retail_complains | select count(email) from client where email not like '%@gmail.com' | Question: how many clients have an email account other than gmail.com? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, ... | how many clients have an email account other than gmail.com? |
retail_complains | select client_id from events where `consumer consent provided?` = 'n/a' or 'consumer consent provided?' is null or 'consumer consent provided?' = '' | Question: identify by their id all clients who did not give their consent permission. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, mon... | identify by their id all clients who did not give their consent permission. |
retail_complains | 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' | Question: list by their id the complaints received by the company on 25/09/2014 that took the longest. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_... | list by their id the complaints received by the company on 25/09/2014 that took the longest. |
retail_complains | select distinct `complaint id` from callcenterlogs where priority = 2 order by `date received` desc | Question: list priority 2 complaints by date received. | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, first, m... | list priority 2 complaints by date received. |
retail_complains | select count(outcome) from callcenterlogs where outcome != 'agent' | Question: how many complaints are not in process with an agent? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social,... | how many complaints are not in process with an agent? |
retail_complains | 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' | Question: how many credit card complaints did sharon handle? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, social, fi... | how many credit card complaints did sharon handle? |
retail_complains | 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 | Question: in which region have the most 1-star reviews been done? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, socia... | in which region have the most 1-star reviews been done? |
retail_complains | 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 | Question: in what years were the clients who demanded more problems with certificate of deposit born? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_i... | in what years were the clients who demanded more problems with certificate of deposit born? |
retail_complains | 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' | Question: how many cases of billing dispute issues occurred in the mountain division? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, mon... | how many cases of billing dispute issues occurred in the mountain division? |
retail_complains | 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' | Question: how many male clients are from the state of massachusetts? | Tables: state -> StateCode, State, Region. callcenterlogs -> Date received, Complaint ID, rand client, phonefinal, vru+line, call_id, priority, type, outcome, server, ser_start, ser_exit, ser_time. client -> client_id, sex, day, month, year, age, so... | how many male clients are from the state of massachusetts? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.