question stringlengths 24 325 | sql stringlengths 30 804 | db_id stringclasses 63
values | prompt stringlengths 308 18.9k | question_id int64 167 9.43k | difficulty stringclasses 1
value |
|---|---|---|---|---|---|
How many times per year does a credit card customer complain about overlimit fees? | 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`) | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 367 | |
Among the clients in Middle Atlantic, how many are them are female and no more than 18 years old? | SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Middle Atlantic' AND T1.sex = 'Female' AND T1.age < 18 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 368 | |
Give me the full birthdate, email and phone number of the youngest client in Indianapolis . | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 369 | |
List the top five cities in terms of the number of 5-star ratings in 2016 reviews, in descending order. | SELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 AND T1.Date LIKE '2016%' ORDER BY T1.Date DESC LIMIT 5 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 370 | |
What is the longest server time when the call is about the issue of arbitration? | SELECT MAX(T1.ser_time) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.issue = 'Arbitration' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 371 | |
Give me the social number and state of the client whose phone number is 100-121-8371. | SELECT T1.social, T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T1.phone = '100-121-8371' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 372 | |
List the full names and phone numbers of clients that were from the Pacific. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 373 | |
What is the social number of the client who has the longest delay in his/her complaint? Calculate the days of delay and state the company's response to the consumer. | SELECT T1.social , 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)), T2.`Company response to consumer` FROM cli... | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 374 | |
How many female clients are there older than 30? | SELECT COUNT(sex) FROM client WHERE sex = 'Female' AND age > 30 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 375 | |
Please list all first and last names of clients who live in New York city. | SELECT first, last FROM client WHERE city = 'New York City' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 376 | |
What is the oldest age of male clients? | SELECT MAX(age) FROM client WHERE sex = 'Male' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 377 | |
Please calculate the number of clients by each division. | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 378 | |
What is the percentage of female clients in the Middle Atlantic? | SELECT CAST(SUM(CASE WHEN T1.sex = 'Female' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'South Atlantic' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 379 | |
What is the average age of clients in South Atlantic? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 380 | |
Which city in the Midwest region has the least number of clients? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 381 | |
How many customers in the Northeast use Microsoft email? | SELECT COUNT(T1.email) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast' AND T1.email LIKE '%@outlook.com' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 382 | |
Which city in West North Central has the highest number of customers over the age of 60? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 383 | |
What is the percentage of complaints about the late fee issue whose priority is 2 in 2017? | SELECT CAST(SUM(CASE WHEN T1.priority = 2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2017' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 384 | |
Which state has the most cities? | SELECT state_abbrev FROM district GROUP BY state_abbrev ORDER BY COUNT(city) DESC LIMIT 1 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 385 | |
Please give the first name and phone number of the client whose complaint id is CR0922485. | SELECT T1.first, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0922485' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 386 | |
Please list the emails of the clients whose complaint date received is 7/3/2014. | SELECT T1.email FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2014-07-03' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 387 | |
In 2012, how many complaints about Credit card product came from clients in Omaha? | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Omaha' AND strftime('%Y', T2.`Date received`) = '2012' AND T2.Product = 'Credit card' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 388 | |
From 2012 to 2015, how many complaints were submitted via email from female clients? | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2012' AND '2015' AND T2.`Submitted via` = 'Email' AND T1.sex = 'Male' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 389 | |
Please list all clients' phone numbers and complaint IDs which are still in progress. | SELECT T1.phone, T2.`Complaint ID` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 390 | |
In 2015, how many complaints about Billing disputes were sent by clients in Portland? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 391 | |
In 2014, what is the percentage of complaints from consumers in Houston that the delay was over 5 days? | SELECT CAST((SUM(CASE WHEN strftime('%J', T2.`Date sent to company`) - strftime('%J', T2.`Date received`) > 5 THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Houston' AND strftime('%Y', T2.`Date received`) = '2014' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 392 | |
In the complains received in 2012, how many of them are submitted through email? | SELECT COUNT(`Submitted via`) FROM events WHERE strftime('%Y', `Date received`) = '2012' AND `Submitted via` = 'Email' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 393 | |
Give the client ID of the complaint received on April 16, 2014 and submitted through fax. | SELECT T2.Client_ID FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Fax' AND T1.`Date received` = '2014-04-16' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 394 | |
List date of the review of the Eagle Capital from Indianapolis, Indiana. | SELECT T2.Date FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Product = 'Eagle Capital' AND T1.city = 'Indianapolis' AND T1.state_abbrev = 'IN' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 395 | |
Among the complaints received in year 2015, what is total number of complaints timely response and closed with an explanation? | SELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2015' AND T2.`Timely response?` = 'Yes' AND T2.`Company response to consumer` = 'Closed with explanation' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 396 | |
Among the female clients that age between 20 to 40, list the date when their complaints were received. | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 397 | |
List the product reviewed with 1 star on March 14, 2016 from Newton, Massachusetts. | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 398 | |
In reviews for the Eagle National Bank product, how many of the 5 star reviews where from Nashville, Tennessee? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 399 | |
What are the issues of the complains of male clients and products from age 25 and below? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 400 | |
Among the reviews from midwest region, what are the products that received 1 star? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 401 | |
List the products involved in the complaints received on March 2017 via TOVA server. | SELECT DISTINCT T2.Product FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.server = 'TOVA' AND T2.`Date received` LIKE '2017-03%' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 402 | |
What is the division of the review of 5 stars received on December 17, 2017 for the product Eagle National Mortgage? | SELECT T1.division FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 AND T2.Date = '2017-12-17' AND T2.Product = 'Eagle National Mortgage' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 403 | |
In complaints about the credit card product, list the phone number of the oldest client. | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 404 | |
In complaints received in 2014, how many of them were submitted via call? | 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' | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 405 | |
List the product and its issues of the complains of clients with age greater than the 60% of average age of all clients. | 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 ) | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 406 | |
In reviews of product with 5 stars, what is the percentage of the reviews coming from the division of East North Central? | 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 | retail_complains | Database Schema:
callcenterlogs (Date received date, Complaint ID text, rand client text, phonefinal text, vru+line text, call_id integer, priority integer, type text, outcome text, server text, ser_start text, ser_exit text, ser_time text, , PRIMARY KEY(Complaint ID), FOREIGN KEY(rand client) REFERENCES client(client_... | 407 | |
Please list the names of the production company of the movie "Four Rooms". | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 408 | |
How many production companies does the movie "Four Rooms" have? | SELECT COUNT(CNAME) FROM ( SELECT T1.company_name AS CNAME 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' ) | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 409 | |
Please list the titles of all the movie produced by production company "Universal Pictures". | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 410 | |
What is the title of the latest released movie produced by production company "Universal Pictures"? | 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' ORDER BY T3.release_date DESC LIMIT 1 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 411 | |
What is the name of the director of photography of the movie "Pirates of the Caribbean: At World's End"? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 412 | |
What was the job of Dariusz Wolski in the movie "Pirates of the Caribbean: At World's End"? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 413 | |
Please list the names of all the crew members of the movie "Pirates of the Caribbean: At World's End". | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 414 | |
How many crew members worked as producer in the movie "Pirates of the Caribbean: At World's End"? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 415 | |
Please list the names of all the producers in the movie "Pirates of the Caribbean: At World's End". | 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 = 'Producer' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 416 | |
In how many movie does Dariusz Wolski work as the director of photography? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 417 | |
Among the movie in which Dariusz Wolski works as the director of photography, what is the title of the one with the highest average vote? | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 418 | |
When was the release date of the latest movie in which Dariusz Wolski worked as a crew member? | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 419 | |
Among the movie in which Dariusz Wolski works as the director of photography, what is the percentage of those movie whose vote average is over 5.0? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 420 | |
What is the average revenue of the movie in which Dariusz Wolski works as the director of photography? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 421 | |
Give the name of the movie with a revenue of 559852396. | SELECT title FROM movie WHERE revenue = 559852396 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 422 | |
What was David Rubin's job in the movie "Days of Thunder"? | 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 T3.person_name = 'David Rubin' AND T1.title = 'Days of Thunder' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 423 | |
How many movies were directed by Michael Bay? | 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 = 'Michael Bay' AND T2.job = 'Director' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 424 | |
Show the total number of keywords of the movie "I Hope They Serve Beer in Hell". | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 425 | |
For the movie "Land of the Dead", who is its director? | 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 = 'Land of the Dead' AND T2.job = 'Director' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 426 | |
Tell the number of movies made by Paramount Animation. | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 427 | |
How many female characters are there in the movie "Spider-Man 3"? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 428 | |
Provide the most used keyword in the movies. | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 429 | |
How many producers does the movie "The Amityville Horror" have? | SELECT COUNT(T2.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Amityville Horror' AND T2.job = 'Producer' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 430 | |
What is the production company of the movie "Crazy Heart"? | 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 = 'Crazy Heart' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 431 | |
Give the number of movies with "saving the world" as the keyword. | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 432 | |
For all the movies which were produced by Cruel and Unusual Films, which one has the most popularity? | 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 = 'Cruel and Unusual Films' ORDER BY T3.popularity DESC LIMIT 1 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 433 | |
For the movie "Reign of Fire", which department was Marcia Ross in? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 434 | |
Calculate the average budget of the movies directed by Jaume Collet-Serra. | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 435 | |
What is the percentage of male characters in the movie "Bride Wars"? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 436 | |
What is the title of the movie that was made with the most money and resources? | SELECT title FROM movie ORDER BY budget DESC LIMIT 1 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 437 | |
How many movies have made at least 1 Billion at the box office? | SELECT COUNT(movie_id) FROM movie WHERE revenue > 1000000000 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 438 | |
When was the first movie released? | SELECT MIN(release_date) FROM movie WHERE movie_status = 'Released' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 439 | |
How many crew are named John Young? | SELECT COUNT(person_id) FROM person WHERE person_name = 'John Young' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 440 | |
Provide the title of the movie that is most-liked by a large number of people. | SELECT title FROM movie ORDER BY popularity DESC LIMIT 1 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 441 | |
Who is the person associated with the crew id 1325273? | SELECT person_name FROM person WHERE person_id = 1325273 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 442 | |
What is the name of the production company that made the most movies? | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 443 | |
Who played Captain Jack Sparrow in all of the Pirates of the Caribbean movies? | 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%' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 444 | |
What is Walt Disney Pictures' most popular movie? | 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 = 'Walt Disney Pictures' ORDER BY T3.popularity DESC LIMIT 1 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 445 | |
How many movies did Universal Studios release? | 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 = 'Universal Studios' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 446 | |
Which production company produced the movie that made the most money at the box office? | 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 GROUP BY T1.company_id ORDER BY SUM(T3.revenue) DESC LIMIT 1 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 447 | |
How many female crews are in the movie "Mr. Smith Goes to Washington"? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 448 | |
List the names of the production companies that made at least 200 movies. | 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 HAVING COUNT(T2.movie_id) > 200 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 449 | |
How many movies did Harrison Ford appear in total? | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 450 | |
What is the title of Jamie Foxx's most recent movie? | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 451 | |
How many movies released in 1995 did Quentin Tarantino appear in? | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 452 | |
What is the title of the first crime movie ever released? | 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 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 453 | |
How many horror movies are there? | SELECT COUNT(T1.movie_id) FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id WHERE T2.genre_name = 'Horror' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 454 | |
List the person IDs of the second film editors in Movie No. 12. | SELECT person_id FROM movie_crew WHERE movie_id = 12 AND job = 'Second Film Editor' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 455 | |
How many animators does Movie No. 129 have? | SELECT COUNT(movie_id) FROM movie_crew WHERE movie_id = 129 AND job = 'Animation' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 456 | |
In Movie No. 19, how many people are there in Department No. 7? Please give me their job. | SELECT COUNT(DISTINCT job) FROM movie_crew WHERE movie_id = 19 AND department_id = 7 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 457 | |
Write the person ID and character name of casts between order numbers 1 and 10 in Movie No. 285. | SELECT person_id, character_name FROM movie_cast WHERE movie_id = 285 AND cast_order BETWEEN 1 AND 10 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 458 | |
How many times did Bob Peterson appear in the movie credits? | 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 = 'Bob Peterson' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 459 | |
Tally the movie ID and character name in the movie starring Jim Carrey. | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 460 | |
Give the names of the female cast in Movie No. 1865. | 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' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 461 | |
Write me the titles of the movies starring Jim Carrey. | 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 = 'Jim Carrey' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 462 | |
List the director's name of the movies released between 1/01/1916 and 12/31/1925. | SELECT T2.person_name FROM movie_cast AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.person_id INNER JOIN movie AS T3 ON T1.movie_id = T3.movie_id INNER JOIN movie_crew AS T4 ON T1.movie_id = T4.movie_id WHERE T4.job = 'Director' AND T3.release_date BETWEEN '1916-01-01' AND '1925-12-31' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 463 | |
How many films released between 1/2/1990 and 12/30/2000 starred Uma Thurman? | 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 = 'Uma Thurman' AND T1.release_date BETWEEN '1990-01-01' AND '2000-12-31' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 464 | |
Write the titles of horror films with a vote average of more than 7. | 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 = 'Horror' AND vote_average > 7 | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 465 | |
Give the genre and popularity of movies whose revenue is at least 120,000,000 between 2012 and 2015. | SELECT T3.genre_name, T1.popularity 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 T1.revenue > 120000000 AND T1.release_date BETWEEN '2012-01-01' AND '2015-12-31' | movies_4 | Database Schema:
country (country_id integer, country_iso_code text, country_name text, , PRIMARY KEY(country_id), )
#department (department_id integer, department_name text, , PRIMARY KEY(department_id), )
#gender (gender_id integer, gender text, , PRIMARY KEY(gender_id), )
#genre (genre_id integer, genre_name text, ,... | 466 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.