context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | Which city did Victoria P Ashworth work in? | 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' | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | How many sales did the store in Remulade make? | 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' | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | For the quantities, what percent more did the store in Fremont sell than the store in Portland in 1993? | 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' | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | Among all the employees, how many percent more for the publishers than designers? | 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 | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | 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. | SELECT fname, minit, lname FROM employee WHERE STRFTIME('%Y', hire_date) BETWEEN '1990' AND '1995' ORDER BY job_lvl DESC | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | Which titles has above average royalty rate? Give those title's name, type and price? | 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 ) | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | In 1994 which title had less order quanty than the average order quantity? Find the title name, type and price. | 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 ) | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | List the title name, type, and price of the titles published by New Moon Books. Arrange the list in ascending order of price. | 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 | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | In the books published by US publishers, which book has the highest royalty? List these books in the descending order of royalty. | 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 | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | Find the difference between the average royalty of titles published by US and non US publishers? | 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... | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | Calculate the average level difference between the Marketing editors hired by the US and non-US publishers? | 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... | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | 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? | 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.' | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | 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? | 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.' | bird |
CREATE TABLE book_publishing_company (au_id text, au_lname text, au_fname text, phone text, address text, city text, state text, zip text, contract text, job_id integer, job_desc text, min_lvl integer, max_lvl integer, pub_id text, pub_name text, city text, state text, country text, emp_id text, fname text, minit text,... | Name the top five titles that sold more than average and list them in descending order of the number of sales in California stores? | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | On which day was the most verbose complaint received? | SELECT `Date received` FROM callcenterlogs WHERE ser_time = ( SELECT MAX(ser_time) FROM callcenterlogs ) | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | When did the earliest complaint start on 2017/3/22? | SELECT MIN(ser_time) FROM callcenterlogs WHERE `Date received` = '2017-03-22' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Which complaint is more urgent, complaint ID CR2400594 or ID CR2405641? | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Please list the full names of all the male clients born after the year 1990. | SELECT first, middle, last FROM client WHERE year > 1990 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | How many complaints have the client Diesel Galloway filed? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What is the detailed product of the complaint filed by Diesel Galloway on 2014/7/3? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Was the tag in the complaint filed by Matthew Pierce on 2016/10/28 approved by himself? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | For how long was the complaint filed by Matthew Pierce on 2016/10/28 delayed? | 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_... | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What is the full name of the client whose complaint on 2017/3/27 was received by MICHAL? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | For how long did the complaint filed on 2017/3/27 by Rachel Hicks last? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Among all the clients from the New York city, how many of them have filed a complaint on the issue of Deposits and withdrawals? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Please list the full names of all the clients whose complaints are still in progress. | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Among the clients who did receive a timely response for their complaint, how many of them are from New York? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | How many complaints on credit cards in the year 2016 were filed by male clients? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Which division is Diesel Galloway in? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Please list the full names of all the male clients in the Pacific division. | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What is the average number of complaints on credit cards filed by clients from New York in the 3 consecutive years starting from 2015? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What is the percentage of the increase of complaints filed by the clients from New York from the year 2016 to the year 2017? | 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... | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What was the serve time for the complaint call from client "C00007127" on 2017/2/22? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Which state does the owner of "[email protected]" live in? Give the full name of the state. | SELECT T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.email = '[email protected]' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Which detailed product did Mr Lennox Oliver Drake complain about? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What was the detailed issue did Mr Gunner Omer Fuller complain about? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Did Ms. Lyric Emely Taylor provide the consent for result of the complaint call on 2016/5/20? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18? | 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... | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Which district did the review on 2018/9/11 come from? Give the name of the city. | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | What was the review context from Jacksonville on 2017/7/22? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | Which product received a review from Indianapolis on 2016/10/7? | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 ) | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | List all the states in the South region. | SELECT state FROM state WHERE Region = 'South' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 ) | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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`... | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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... | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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... | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | List by their ID number the 3 longest complaints. | SELECT `Complaint ID` FROM callcenterlogs ORDER BY ser_time DESC LIMIT 3 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | How many clients have an email account other than gmail.com? | SELECT COUNT(email) FROM client WHERE email NOT LIKE '%@gmail.com' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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?' = '' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | List priority 2 complaints by date received. | SELECT DISTINCT `Complaint ID` FROM callcenterlogs WHERE priority = 2 ORDER BY `Date received` DESC | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | How many complaints are not in process with an agent? | SELECT COUNT(outcome) FROM callcenterlogs WHERE outcome != 'AGENT' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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?` != '' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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%' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 ) | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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' | bird |
CREATE TABLE retail_complains (StateCode text, State text, Region text, 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, client_id text, sex text, day integer, m... | 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 | bird |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.