prompt
stringlengths
169
37.8k
completion
stringlengths
30
1.53k
source_tag
stringclasses
11 values
evidence
stringlengths
0
673
exec_acc
float64
-1
1
has_cte
bool
2 classes
has_window
bool
2 classes
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
more urgent refers to MAX(priority);
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
detailed product refers to "sub-product"; on 2014/7/3 refers to "Date received" = '2014-07-03';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
on 2016/10/28 refers to "Date received" = '2016-10-28'; delayed = SUBTRACT("Date sent to company', 'Date received");
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
full names = first, middle, last; on 2017/3/27 refers to "Date received" = '2017-03-27'; MICHAL refers to server = 'MICHAL';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
how long did the complaint filed last refers to ser_time; on 2017/3/27 refers to "Date received" = '2017-03-27';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
full name = first, middle, last; complaints are still in progress refers to "Company response to consumer" = 'In progress';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
credit cards refers to Product = 'Credit card'; 2016 refers to year(Date received) = 2016; male refers to sex = 'Male';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
percentage of increase = MULTIPLY(DIVIDE(SUBTRACT(SUM(year("Date received") = 2017), SUM(year("Date received") = 2016)), SUM(year("Date received") = 2016)), 1.0); New York refers to city = 'New York'; year("Date received") BETWEEN 2016 AND 2017;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
serve time refers to ser_time; longer ser_time means more verbose or longer complaint; on 2017/2/22 refers to "Date received" = '2017-02-22';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
detailed product refers to "Sub-product"; Mr refers to sex = 'Male';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
Ms refers to sex = 'Female'; "Consumer consent provided?" in (null, 'N/A', 'Empty') means that the company didn't get the permission of consent; "Consumer consent provided?" not in (null, 'N/A', 'Empty') means the customers provide the consent; on 2016/5/20 refers to Date received = '2016-05-20';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
Jacksonville refers to city = 'Jacksonville'; on 2017/7/22 refers to Date = '2017-07-22';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
Indianapolis refers to state = 'Indianapolis'; on 2016/10/7 refers to Date = '2013-04-04';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
Eagle Capital refers to Product = 'Eagle Capital'; Little Rock is a city; on 2013/4/4 refers to Date = '2013-04-04';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
complaint call refers to Complaint ID; birthday = year, month, day;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
on 2017/3/27 refers to "Date received" = '2017-03-27'; percentage = MULTIPLY(DIVIDE(SUM(sex = 'Female' ), COUNT(client_id)), 1.0); females refers to sex = 'Female';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T.Product, MAX(T.num) FROM ( SELECT Product, COUNT(Stars) AS num FROM reviews WHERE Stars = 5 GROUP BY Product ) T
bird_train
most five stars refers to MAX(COUNT(stars = 5));
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
average age = AVG(age);
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
teenage refers to age BETWEEN 12 AND 20;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
born between 1980 and 2000 refers to year BETWEEN 1980 AND 2000; name = first, middle, last; male refers to sex = 'Male'; complained through refers to "Submitted via";
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
medium refers to "Submitted via"; most complaints refers to MAX(Complaint ID); Florida refers to state = 'florida';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
average = AVG("Complaint ID"); New Bedford refers to city = 'New Bedford'; closed with explanation refers to Company response to consumer = 'Closed with explanation';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
California refers to state = 'California'; percentage = MULTIPLY(DIVIDE(SUM(priority = 1), COUNT("Complaint ID"), 1.0));
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
difference in the average = SUBTRACT(AVG(age BETWEEN 35 AND 55), AVG( age > 65)); elderly refers to age > 65; middle-aged refers to age BETWEEN 35 AND 55;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
ID of the complaints refers to "Complaint ID"; on 25/09/2014 refers to "Date sent to company" = '2014-09-25'; took the longest = MAX(SUBTRACT("Date sent to company", "Date received"));
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
most 1-star reviews refers to MAX(COUNT(stars = 1));
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
male refers to sex = 'Male';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
name refers to first; provided consent refers to "Consumer consent provided?" not in ('N/A', null, 'empty');
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
women refers to sex = 'Female'; served after 3 pm refers to ser_time BETWEEN '15:00:01' AND '23:59:59'; received a timely response refers to "Timely response?" = 'Yes';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
served in 5 minutes or less refers to ser_time < '00:05:00'; DORIT refers to server = 'DORIT'; responded with an explanation refers to "Company response to consumer" = 'Closed with explanation'; made by refers to "Submitted via";
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
between 30 and 50 years refers to age BETWEEN 30 AND 50; include the word great refers to Review like '%Great%';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
full address = address_1, address_2; received a timely response refers to Timely response? = 'Yes'; have dispute refers to "Consumer disputed?" = 'Yes';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
average age = AVG(age); Norwalk refers to city = 'Norwalk';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
1-star review refers stars = 1;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
highest number of clients refers to MAX(COUNT(client_id)); 5-star review refers to stars = 5;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
year > 2005;
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
how long refers to ser_time; credit card refers to Product = 'Credit Card';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
longest server time refers to MAX(ser_time);
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
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_train
percentage = MULTIPLY(DIVIDE(SUM(sex = 'Male'), COUNT(client_id)), 1.0); male refers to sex = 'Male'; credit cards refers to Product = 'Credit card';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.first, T2.middle, T2.last FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.division = 'Pacific'
bird_train
full name refers to first, last
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kaitlyn' AND T1.middle = 'Eliza' AND T1.last = 'Elliott'
bird_train
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division ORDER BY COUNT(T2.division) DESC LIMIT 1, 1
bird_train
region refers to division; second most refers to second max(client_id)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT CASE WHEN SUM(CASE WHEN email LIKE '%@gmail.com' THEN 1 ELSE 0 END) > SUM(CASE WHEN email LIKE '%@outlook.com' THEN 1 ELSE 0 END) THEN 'Google account' ELSE 'Microsoft account' END FROM client WHERE age BETWEEN 13 AND 19
bird_train
teenager refers to 13 < age < = 19; Google account refers to email like '%@gmail.com'; Microsoft account refers to email like '%@outlook.com'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.first FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = ( SELECT MAX(priority) FROM callcenterlogs )
bird_train
first name refers to first; highest priority refers to priority = 2
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.age > 65 AND T2.server = 'YIFAT'
bird_train
elder refers to age < = 65; last name refers to last
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT COUNT(T2.`rand client`) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.city = 'New York City' AND T2.outcome = 'AGENT'
bird_train
New York City refers to city = 'New York City'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age > 65 ORDER BY T1.client_id DESC LIMIT 1
bird_train
most complaints refers to max(client_id); elder client refers to age > 65
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END), SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 1 ELSE 0 END) AS adult , SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS elder FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card'
bird_train
about Credit Card refers to Product = 'Credit Card'; teenager refers to 13 < age < = 19; adult refers to 19 < age < = 65; elder refers to age < = 65
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Issue = 'Balance transfer'
bird_train
full name refers to first, middle, last; issue about balance transfer refers to Issue = 'Balance transfer'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.email FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail'
bird_train
via postal mail refers to Submitted via = 'Postal mail'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT AVG(T1.age) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'Closed with relief'
bird_train
average age = avg(age where Company response to consumer = 'Closed with relief'); response "Closed with relief" refers to Company response to consumer = 'Closed with relief'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT strftime('%Y', `Date received`), COUNT(`Date received`) FROM events WHERE product = 'Credit card' AND issue = 'Overlimit fee' GROUP BY strftime('%Y', `Date received`) HAVING COUNT(`Date received`)
bird_train
credit card customer refers to product = 'Credit card'; about overlimit fees refers to issue = 'Overlimit fee'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.year, T1.month, T1.day, T1.email, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Indianapolis' ORDER BY T1.year DESC, T1.month DESC, T1.day DESC LIMIT 1
bird_train
full birthdate = year, month, day; youngest refers to max(year, month, day); in Indianapolis refers to city = 'Indianapolis'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific'
bird_train
full name refers to first, middle, last; the Pacific refers to division = 'Pacific'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.division, COUNT(T2.division) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division
bird_train
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT AVG(T1.age) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'South Atlantic'
bird_train
in South Atlantic refers to division = 'South Atlantic'; average age refers to avg(age)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest' GROUP BY T2.city ORDER BY COUNT(T2.city) LIMIT 1
bird_train
least number of clients refers to min(count(client_id))
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'West North Central' AND T1.age > 60 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1
bird_train
in North Central refers to Region = 'North Central'; highest number of customers refers to max(count(client_id)); over the age of 60 refers to age > 60
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT state_abbrev FROM district GROUP BY state_abbrev ORDER BY COUNT(city) DESC LIMIT 1
bird_train
state refers to state_abbrev; most cities refers to max(count(city))
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Portland' AND T2.`Date received` LIKE '2015%' AND T2.Issue = 'Billing disputes'
bird_train
in 2015 refers to Date received LIKE'2015%'; about Billing disputes refers to Issue = 'Billing disputes'; Portland refers to city = 'Portland'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT DISTINCT T3.`Date received` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID INNER JOIN callcenterlogs AS T3 ON T2.`Complaint ID` = T3.`Complaint ID` WHERE T1.age BETWEEN 20 AND 40 AND T1.sex = 'Female'
bird_train
female refers to sex = 'Female'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T2.Product FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Newton' AND T1.state_abbrev = 'MA' AND T2.Date = '2016-03-14' AND T2.Stars = 1
bird_train
1 star refers to Stars = 1; on March 14, 2016 refers to Date = '2016-03-14'; Newton refers to city = 'Newton'; Massachusetts refers to state_abbrev = 'MA'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT COUNT(T2.Stars) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Nashville' AND T1.state_abbrev = 'TN' AND T2.Product = 'Eagle National Mortgage' AND T2.Stars = 5
bird_train
5 star refers to Stars = 5; Nashville refers to city = 'Nashville'; Tennessee refers to state_abbrev = 'TN'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.age < 25
bird_train
male refers to sex = 'Male'; age 25 and below refers to age < 25
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT DISTINCT T3.Product FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN reviews AS T3 ON T2.district_id = T3.district_id WHERE T1.Region = 'Midwest' AND T3.Stars = 1
bird_train
1 star refers to Stars = 1
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card' ORDER BY T1.age DESC LIMIT 1
bird_train
oldest refers to max(age)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT COUNT(T2.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Phone' AND strftime('%Y', T1.`Date received`) = '2014'
bird_train
in 2014 refers to Date received LIKE '2014%'; submitted via call refers to Submitted via = 'Phone'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT DISTINCT T2.Product, T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age * 100 > ( SELECT AVG(age) * 60 FROM client )
bird_train
age greater than the 60% of average age refers to age > multiply(avg(age) , 0.6)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ) CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand ...
SELECT CAST(SUM(CASE WHEN T1.division = 'East North Central' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.division) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5
bird_train
5 stars refers to Stars = 5; percentage = divide(count(division = 'East North Central', count(division)) * 100%
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Four Rooms'
bird_train
names of the production company refers to movie_company; movie "Four Rooms" refers to title = 'Four Rooms'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Universal Pictures'
bird_train
"Universal Pictures" refers to company_name = 'Universal Pictures'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Director of Photography'
bird_train
name of the director of photography refers to person_name where job = 'Director of Photography'; "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T2.job FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T3.person_name = 'Dariusz Wolski'
bird_train
movie "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T3.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Producer'
bird_train
worked as producer refers to job = 'Producer'; "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'
bird_train
director of photography refers to job = 'Director of Photography'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.title FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography' ORDER BY T1.vote_average DESC LIMIT 1
bird_train
director of photography refers to job = 'Director of Photography'; highest average vote refers to max(vote_average)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.release_date FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' ORDER BY T1.release_date DESC LIMIT 1
bird_train
release date of the latest movie refers to max(release_date)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT CAST(COUNT(CASE WHEN T1.vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.vote_average) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'
bird_train
director of photography refers to job = 'Director of Photography'; vote average is over 8.0 refers to vote_average > 5; percentage = divide(sum(movie_id) when vote_average > 5, count(movie_id)) as percentage
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT CAST(SUM(T1.revenue) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'
bird_train
director of photography refers to job = 'Director of Photography'; average revenue = divide(sum(revenue), count(movie_id))
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T2.keyword_id) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'I Hope They Serve Beer in Hell'
bird_train
"I Hope They Serve Beer in Hell" refers to title = 'I Hope They Serve Beer in Hell';
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Paramount Animation'
bird_train
Paramount Animation refers to company_name = 'Paramount Animation'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(*) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Spider-Man 3' AND T3.gender = 'Female'
bird_train
female characters refer to gender = 'Female'; "Spider-Man 3" refers to title = 'Spider-Man 3'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.keyword_name FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id GROUP BY T1.keyword_name ORDER BY COUNT(T1.keyword_name) DESC LIMIT 1
bird_train
most used keyword refers to keyword_name where max(count(keyword_name))
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T2.movie_id) FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id WHERE keyword_name = 'saving the world'
bird_train
"saving the world" as the keyword refers to keyword_name = 'saving the world'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T3.person_name = 'Marcia Ross' AND T1.title = 'Reign of Fire'
bird_train
movie "Reign of Fire" refers to title = 'Reign of Fire'; which department refers to department_name
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT CAST(SUM(T1.budget) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jaume Collet-Serra' AND T2.job = 'Director'
bird_train
directed by refers to job = 'Director'; average budget = AVG(budget)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT CAST(COUNT(CASE WHEN T3.gender = 'Male' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T3.gender) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Bride Wars'
bird_train
male refers to gender = 'Male'; "Bride Wars" refers to title = 'Bride Wars'; percentage = divide(sum(gender = 'Male'), count(gender)) * 100 as percentage
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1
bird_train
name of the production company refers to company_name; most movies refers to max(count(company_name))
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT DISTINCT T3.person_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T2.character_name = 'Captain Jack Sparrow' AND T1.title LIKE 'Pirates of the Caribbean%'
bird_train
Captain Jack Sparrow refers to character_name = 'Captain Jack Sparrow'; Pirates of the Caribbean movies refers to title LIKE 'Pirates of the Carribbean%'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T3.gender) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Mr. Smith Goes to Washington' AND T3.gender = 'Female'
bird_train
female crews refers to gender = 'Female'; "Mr. Smith Goes to Washington" refers to title = 'Mr. Smith Goes to Washington'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Harrison Ford'
bird_train
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jamie Foxx' ORDER BY T1.release_date DESC LIMIT 1
bird_train
most recent movie refers to max(release_date)
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Quentin Tarantino' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 1995
bird_train
released in 1995 refers to release_date LIKE '1995%'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Crime' ORDER BY T1.release_date LIMIT 1
bird_train
first crime movie ever released refers to min(release_date) and genre_name = 'Crime'
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT person_id FROM movie_crew WHERE movie_id = 12 AND job = 'Second Film Editor'
bird_train
second film editors refers to job = 'Second Film Editor'; Movie No. 12 refers to movie_id = 12
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT COUNT(DISTINCT job) FROM movie_crew WHERE movie_id = 19 AND department_id = 7
bird_train
Movie No. 19 refers to movie_id = 19; Department No. 7 refers to department_id = 7
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T2.movie_id, T2.character_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Jim Carrey'
bird_train
1
false
false
You are an expert SQL assistant. Convert the question to a valid SQL query. Database schema: CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ) CREATE TABLE department ( department_id INTEGER not ...
SELECT T2.person_name FROM movie_cast AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.person_id INNER JOIN gender AS T3 ON T1.gender_id = T3.gender_id WHERE T1.movie_id = 1865 AND T3.gender = 'Female'
bird_train
female cast refers to gender = 'Female'; name of cast refers to person_name; Movie No. 1865 refers to movie_id = 1865
1
false
false