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
Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE (T1.lastname = 'Adams' AND T1.firstname = 'Sandy') OR (T1.lastname = 'Rodriguez' AND T1.firstname = 'Jose') ORDER BY T2.educationrequired DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?
8,944
Please list the zip codes of the offices where all the male employees with a good job performance work at.
SELECT T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.gender = 'M' AND T1.performance = 'Good'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Please list the zip codes of the offices where all the male employees with a good job performance work at.
8,945
Please list the social security numbers of all the employees who work in California.
SELECT T1.ssn FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.state = 'CA'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Please list the social security numbers of all the employees who work in California.
8,946
Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year?
SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) > 20000 AND T2.positiontitle = 'Trainee'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year?
8,947
What is the average salary of the employees who work as a Trainee?
SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) AS avg FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the average salary of the employees who work as a Trainee?
8,948
By what percentage is the average salary of Trainees higher than the minimum salary of this postion?
SELECT 100 * (AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # By what percentage is the average salary of Trainees higher than the minimum salary of this postion?
8,949
Give the number of female employees.
SELECT COUNT(*) FROM employee WHERE gender = 'F'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Give the number of female employees.
8,950
State the name of the city where Jose Rodriguez works.
SELECT T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodriguez'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # State the name of the city where Jose Rodriguez works.
8,951
In which state does Emily Wood work?
SELECT T2.state FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.firstname = 'Emily' AND T1.lastname = 'Wood'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # In which state does Emily Wood work?
8,952
What is the education required for David Whitehead to reach his current position?
SELECT T2.educationrequired FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'David' AND T1.lastname = 'Whitehead' AND T1.gender = 'M'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the education required for David Whitehead to reach his current position?
8,953
How many employees are there in the "Miami" office?
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Miami'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How many employees are there in the "Miami" office?
8,954
Who is the highest paid employee in "Boston"? Give the full name.
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Boston' ORDER BY T1.salary DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Who is the highest paid employee in "Boston"? Give the full name.
8,955
Who is the employee in “New York City” with a good performance? Give the social security number of the employee.
SELECT T1.firstname, T1.lastname, T1.ssn FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'New York City' AND T1.performance = 'Good'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Who is the employee in “New York City” with a good performance? Give the social security number of the employee.
8,956
How many "account representatives" are there in Chicago with a good performance?
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T2.locationcity = 'Chicago' AND T1.performance = 'Good'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How many "account representatives" are there in Chicago with a good performance?
8,957
What is Kenneth Charles's position title?
SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Kenneth' AND T1.lastname = 'Charles'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is Kenneth Charles's position title?
8,958
Give the full address of the office of the highest paid manager.
SELECT T2.address FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' ORDER BY T1.salary DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Give the full address of the office of the highest paid manager.
8,959
What is the max salary for 'Tracy Coulter' if he/she stays on his/her position?
SELECT T2.maxsalary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Tracy' AND T1.lastname = 'Coulter'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the max salary for 'Tracy Coulter' if he/she stays on his/her position?
8,960
If Jose Rodriguez tried his best, how many percentage can his salary raise without changing his position?
SELECT 100 * (CAST(REPLACE(SUBSTR(T2.maxsalary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodriguez'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # If Jose Rodriguez tried his best, how many percentage can his salary raise without changing his position?
8,961
How many employees whose performance is poor have a salary of over $50,000 per year?
SELECT COUNT(*) FROM employee WHERE performance = 'Poor' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 50000
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How many employees whose performance is poor have a salary of over $50,000 per year?
8,962
Who is the employee with the highest salary? Specify his/her full name.
SELECT firstname, lastname FROM employee WHERE CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL)) FROM employee )
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Who is the employee with the highest salary? Specify his/her full name.
8,963
How many positions have a maximum salary of no more than US$1000,000?
SELECT COUNT(*) FROM position WHERE CAST(REPLACE(SUBSTR(maxsalary, 4), ',', '') AS REAL) < 100000
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How many positions have a maximum salary of no more than US$1000,000?
8,964
How much is the salary of the first ever employee that was hired?
SELECT salary FROM employee ORDER BY hiredate ASC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How much is the salary of the first ever employee that was hired?
8,965
How much is the minimum salary given to the position with the most complex work?
SELECT minsalary FROM position ORDER BY educationrequired DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How much is the minimum salary given to the position with the most complex work?
8,966
What is the full office location address where most of the employees work at?
SELECT T2.address, T2.locationcity, T2.state, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID GROUP BY T2.address, T2.locationcity, T2.state, T2.zipcode ORDER BY COUNT(*) DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the full office location address where most of the employees work at?
8,967
What is the average salary of all employees with a 2 year degree position?
SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the average salary of all employees with a 2 year degree position?
8,968
How many male Regional Managers are there?
SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Regional Manager' AND T1.gender = 'M'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How many male Regional Managers are there?
8,969
Which position has the highest amount of poor performing employees?
SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Which position has the highest amount of poor performing employees?
8,970
Which position has the highest number of female employees with a 2 year degree?
SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree' AND T1.gender = 'F' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Which position has the highest number of female employees with a 2 year degree?
8,971
How many Account Representatives are there in Illinois with satisfying performance?
SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T1.performance = 'Good' AND T2.state = 'IL'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # How many Account Representatives are there in Illinois with satisfying performance?
8,972
What is the average salary of the worst performing managers?
SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' AND T2.positiontitle = 'Manager'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the average salary of the worst performing managers?
8,973
In which state can you find the highest amount of good performing Account Representatives?
SELECT T2.state FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T1.performance = 'Good' GROUP BY T2.state ORDER BY COUNT(T2.state) DESC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # In which state can you find the highest amount of good performing Account Representatives?
8,974
Mention the employee's full name and performance status who got the lowest in salary per year.
SELECT firstname, lastname, performance FROM employee ORDER BY salary ASC LIMIT 1
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Mention the employee's full name and performance status who got the lowest in salary per year.
8,975
List the location cities in the Western states.
SELECT locationcity FROM location WHERE state IN ('CO', 'UT', 'CA')
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # List the location cities in the Western states.
8,976
Which city and address has zip code of above 90000?
SELECT locationcity, address FROM location WHERE zipcode > 90000
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Which city and address has zip code of above 90000?
8,977
Which positions are suitable with 4 years degree education?
SELECT positiontitle FROM position WHERE educationrequired = '4 year degree'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Which positions are suitable with 4 years degree education?
8,978
What is the maximum salary of position "Trainer"?
SELECT maxsalary FROM position WHERE positiontitle = 'Trainee'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the maximum salary of position "Trainer"?
8,979
List the full name and social security number of the account representative with average performance.
SELECT T1.firstname, T1.lastname, T1.ssn FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Average'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # List the full name and social security number of the account representative with average performance.
8,980
When was Emily Wood hired? Mention her position and salary.
SELECT T1.hiredate, T2.positiontitle, T1.salary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Emily' AND T1.lastname = 'Wood'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # When was Emily Wood hired? Mention her position and salary.
8,981
What are the maximum and minimum salary range and position title of Bill Marlin?
SELECT T2.maxsalary, T2.minsalary, T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Bill' AND T1.lastname = 'Marlin'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What are the maximum and minimum salary range and position title of Bill Marlin?
8,982
List the full names, gender and positions who's location is in New York city.
SELECT T1.firstname, T1.lastname, T1.gender, T3.positiontitle FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T2.locationcity = 'New York City'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # List the full names, gender and positions who's location is in New York city.
8,983
Mention the full name, hired date and performance status of the employee whose location is in Utah state.
SELECT T1.firstname, T1.lastname, T1.hiredate, T1.performance FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.state = 'UT'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Mention the full name, hired date and performance status of the employee whose location is in Utah state.
8,984
Among the employees with poor performance, provide the managers' full names, location city, address and its zip code.
SELECT T1.firstname, T1.lastname, T2.locationcity, T2.address, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' AND T1.performance = 'Poor'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Among the employees with poor performance, provide the managers' full names, location city, address and its zip code.
8,985
What is the education required to be account representative? Mention account representative full name and salary who got poor in performance status.
SELECT T2.educationrequired, T1.firstname, T1.lastname, T1.salary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' AND T2.positiontitle = 'Account Representative'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # What is the education required to be account representative? Mention account representative full name and salary who got poor in performance status.
8,986
Write down the full name, performance status and located city of the employee who's social security number is "767-74-7373".
SELECT T1.firstname, T1.lastname, T2.state, T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.ssn = '767-74-7373'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Write down the full name, performance status and located city of the employee who's social security number is "767-74-7373".
8,987
Describe the employees' full name, positions, located city and office phone number within Colorado state.
SELECT T1.firstname, T1.lastname, T3.positiontitle, T2.locationcity, T2.officephone FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T2.state = 'CO'
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Describe the employees' full name, positions, located city and office phone number within Colorado state.
8,988
Calculate the monthly average salary of the employee with highest salary. Mention his name, position title and location city.
SELECT SUM(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / 12 AS avg, T1.firstname, T1.lastname , T2.positiontitle, T3.locationcity FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID INNER JOIN location AS T3 ON T1.locationID = T3.locationID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID INNER JOIN location AS T3 ON T1.locationID = T3.locationID )
human_resources
Database Schema: employee (ssn text, lastname text, firstname text, hiredate text, salary text, gender text, performance text, positionID integer, locationID integer, , PRIMARY KEY(ssn), FOREIGN KEY(locationID) REFERENCES location(locationID), FOREIGN KEY(positionID) REFERENCES position(positionID)) #location (locationID integer, locationcity text, address text, state text, zipcode integer, officephone text, , PRIMARY KEY(locationID), ) #position (positionID integer, positiontitle text, educationrequired text, minsalary text, maxsalary text, , PRIMARY KEY(positionID), ) # Calculate the monthly average salary of the employee with highest salary. Mention his name, position title and location city.
8,989
What is the description of the film ACADEMY DINOSAUR?
SELECT description FROM film WHERE title = 'ACADEMY DINOSAUR'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the description of the film ACADEMY DINOSAUR?
9,103
How many films have a rental duration of over 6 days?
SELECT COUNT(film_id) FROM film WHERE rental_duration > 6
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many films have a rental duration of over 6 days?
9,104
Please list the titles of the films that are released in 2006 and have a rental rate of $2.99.
SELECT title FROM film WHERE release_year = 2006 AND rental_rate = 2.99
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of the films that are released in 2006 and have a rental rate of $2.99.
9,105
Which film has the longest duration of film screening? Please give its title.
SELECT title FROM film ORDER BY length DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Which film has the longest duration of film screening? Please give its title.
9,106
Which film has a higher replacement cost, ACE GOLDFINGER or ACADEMY DINOSAUR?
SELECT title FROM film WHERE title IN ('ACE GOLDFINGER', 'ACADEMY DINOSAUR') ORDER BY replacement_cost DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Which film has a higher replacement cost, ACE GOLDFINGER or ACADEMY DINOSAUR?
9,107
Among the films that are released in 2006, how many of them are rated Adults Only in the Motion Picture Association Film Rating?
SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND release_year = 2006
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among the films that are released in 2006, how many of them are rated Adults Only in the Motion Picture Association Film Rating?
9,108
How many films with the rental rate of $2.99 have the special feature of "Deleted Scenes"?
SELECT COUNT(film_id) FROM film WHERE rental_rate = 2.99 AND special_features = 'Deleted Scenes'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many films with the rental rate of $2.99 have the special feature of "Deleted Scenes"?
9,109
Please list the titles of all the films that have more than 2 special features.
SELECT title FROM ( SELECT title, COUNT(special_features) AS num FROM film GROUP BY title ) AS T ORDER BY T.num > 2
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of all the films that have more than 2 special features.
9,110
What is the email address of the staff Jon Stephens?
SELECT email FROM staff WHERE first_name = 'Jon' AND last_name = 'Stephens'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the email address of the staff Jon Stephens?
9,111
Please give the full names of all the active staff.
SELECT first_name, last_name FROM staff WHERE active = 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please give the full names of all the active staff.
9,112
In which year was the film with the highest replacement cost released?
SELECT DISTINCT release_year FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film )
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # In which year was the film with the highest replacement cost released?
9,113
Please list the titles of the top 3 films with the highest replacement cost.
SELECT title FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film ) LIMIT 3
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of the top 3 films with the highest replacement cost.
9,114
What is the language of the film ACADEMY DINOSAUR?
SELECT T2.name FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'ACADEMY DINOSAUR'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the language of the film ACADEMY DINOSAUR?
9,115
How many films are in English?
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many films are in English?
9,116
Please list the titles of all the films starring the actor PENELOPE GUINESS.
SELECT T2.title FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T1.actor_id = T3.actor_id WHERE T3.first_name = 'PENELOPE' AND T3.last_name = 'GUINESS'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of all the films starring the actor PENELOPE GUINESS.
9,117
How many actors have starred in the film ACADEMY DINOSAUR?
SELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.title = 'ACADEMY DINOSAUR'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many actors have starred in the film ACADEMY DINOSAUR?
9,118
Please list the full names of all the actors that have starred in the film ACADEMY DINOSAUR.
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'ACADEMY DINOSAUR'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the full names of all the actors that have starred in the film ACADEMY DINOSAUR.
9,119
Among the films starring PENELOPE GUINESS, how many of them are released in 2006?
SELECT COUNT(T2.film_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.release_year = 2006 AND T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among the films starring PENELOPE GUINESS, how many of them are released in 2006?
9,120
Please give the title of the film starring PENELOPE GUINESS and has the highest replacement cost.
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.replacement_cost DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please give the title of the film starring PENELOPE GUINESS and has the highest replacement cost.
9,121
Please list the full names of all the actors that have starred in the film with the highest replacement cost.
SELECT first_name, last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id ORDER BY T3.replacement_cost DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the full names of all the actors that have starred in the film with the highest replacement cost.
9,122
Among the films starring PENELOPE GUINESS, how many of them are in English?
SELECT COUNT(T3.film_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id INNER JOIN language AS T4 ON T3.language_id = T4.language_id WHERE T4.name = 'English' AND T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among the films starring PENELOPE GUINESS, how many of them are in English?
9,123
What is the title of the film with the longest duration time and stars PENELOPE GUINESS?
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.length DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the title of the film with the longest duration time and stars PENELOPE GUINESS?
9,124
Please list the titles of all the films in the category of "Horror".
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of all the films in the category of "Horror".
9,125
How many films are there under the category of "Horror"?
SELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id WHERE T2.name = 'Horror'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many films are there under the category of "Horror"?
9,126
Please list the titles of all the films under the category of "Horror" and has a rental rate of $2.99.
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror' AND T1.rental_rate = 2.99
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of all the films under the category of "Horror" and has a rental rate of $2.99.
9,127
For how many times has the customer RUTH MARTINEZ rented a film?
SELECT COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # For how many times has the customer RUTH MARTINEZ rented a film?
9,128
Please list the titles of all the films that the customer RUTH MARTINEZ has rented.
SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the titles of all the films that the customer RUTH MARTINEZ has rented.
9,129
Among the films that the customer RUTH MARTINEZ has rented, how many of them are released in 2006?
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.release_year = 2006 AND T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among the films that the customer RUTH MARTINEZ has rented, how many of them are released in 2006?
9,130
Among the films that the customer RUTH MARTINEZ has rented, what is the title of the one with the highest replacement cost?
SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' ORDER BY T4.replacement_cost DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among the films that the customer RUTH MARTINEZ has rented, what is the title of the one with the highest replacement cost?
9,131
Please list the full names of all the customers who have rented the film with the highest replacement cost.
SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id ORDER BY T4.replacement_cost DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please list the full names of all the customers who have rented the film with the highest replacement cost.
9,132
How many films rented to the customer RUTH MARTINEZ were returned in August, 2005?
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' AND STRFTIME('%m',T2.return_date) = '8' AND STRFTIME('%Y', T2.return_date) = '2005'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many films rented to the customer RUTH MARTINEZ were returned in August, 2005?
9,133
Please give the full name of the customer that have rented the most films.
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.rental_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Please give the full name of the customer that have rented the most films.
9,134
Among the customers who have rented the film ACADEMY DINOSAUR, how many of them are active?
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.active = 1 AND T4.title = 'ACADEMY DINOSAUR'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among the customers who have rented the film ACADEMY DINOSAUR, how many of them are active?
9,135
Which film is rented for the most times by the customers? Please give its title.
SELECT T.title FROM ( SELECT T1.title, COUNT(T3.rental_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T1.title ) AS T ORDER BY T.num DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Which film is rented for the most times by the customers? Please give its title.
9,136
Which customer has rented more movies, RUTH MARTINEZ or LINDA WILLIAMS?
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE (T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ') OR (T1.first_name = 'LINDA' AND T1.last_name = 'WILLIAMS') GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Which customer has rented more movies, RUTH MARTINEZ or LINDA WILLIAMS?
9,137
Among all the films starring PENELOPE GUINESS, what is the title of the one with the highest rental price per day?
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.rental_rate / T3.rental_duration DESC LIMIT 1
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among all the films starring PENELOPE GUINESS, what is the title of the one with the highest rental price per day?
9,138
What is the average replacement cost of the films under the category of "Horror"?
SELECT AVG(T3.replacement_cost) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Horror'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the average replacement cost of the films under the category of "Horror"?
9,139
Among all films that the customer RUTH MARTINEZ has rented, what is the percentage of it being a Music film?
SELECT CAST(SUM(IIF(T3.name = 'Music', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id INNER JOIN inventory AS T4 ON T1.film_id = T4.film_id INNER JOIN customer AS T5 ON T4.store_id = T5.store_id INNER JOIN rental AS T6 ON T4.inventory_id = T6.inventory_id WHERE T5.first_name = 'RUTH' AND T5.last_name = 'MARTINEZ'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Among all films that the customer RUTH MARTINEZ has rented, what is the percentage of it being a Music film?
9,140
What is the average duration time of the films starring PENELOPE GUINESS?
SELECT AVG(T3.length) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the average duration time of the films starring PENELOPE GUINESS?
9,141
What is Diane Collins' email address?
SELECT email FROM customer WHERE first_name = 'DIANE' AND last_name = 'COLLINS'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is Diane Collins' email address?
9,142
Give the number of inactive customers.
SELECT COUNT(customer_id) FROM customer WHERE active = 0
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Give the number of inactive customers.
9,143
Who is the owner of email address "JEREMY.HURTADO@sakilacustomer.org"? Give the full name.
SELECT first_name, last_name FROM customer WHERE email = 'JEREMY.HURTADO@sakilacustomer.org'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Who is the owner of email address "JEREMY.HURTADO@sakilacustomer.org"? Give the full name.
9,144
Give the postal code for the address No.65.
SELECT postal_code FROM address WHERE address_id = 65
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Give the postal code for the address No.65.
9,145
State the number of addresses in the Nordrhein-Westfalen district.
SELECT COUNT(address_id) FROM address WHERE district = 'Nordrhein-Westfalen'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # State the number of addresses in the Nordrhein-Westfalen district.
9,146
What is the phone number of address No.72?
SELECT phone FROM address WHERE address_id = '72'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the phone number of address No.72?
9,147
State the number of films that are 178 minutes long.
SELECT COUNT(film_id) FROM film WHERE length = '178'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # State the number of films that are 178 minutes long.
9,148
Tell the special features of the film Uprising Uptown.
SELECT special_features FROM film WHERE title = 'UPRISING UPTOWN'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Tell the special features of the film Uprising Uptown.
9,149
What is the description of the film Artist Coldblooded?
SELECT description FROM film WHERE title = 'ARTIST COLDBLOODED'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # What is the description of the film Artist Coldblooded?
9,150
Give the detailed address for store No.2.
SELECT T1.address, T1.address2, T1.district FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id WHERE T2.store_id = 2
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Give the detailed address for store No.2.
9,151
Which continent is the mother country of Clarksville city in?
SELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Clarksville'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Which continent is the mother country of Clarksville city in?
9,152
How many actors played a role in the 2006 film whose rental duration is 7 days, rental rate is 4.99 and is 98 minutes duration?
SELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.release_year = 2006 AND T2.rental_duration = 7 AND T2.rental_duration = 4.99 AND T2.length = 98
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many actors played a role in the 2006 film whose rental duration is 7 days, rental rate is 4.99 and is 98 minutes duration?
9,153
The actor Dan Harris played in a 77 minute film with replacement cost of 9.99, what was the rating for that film?
SELECT T3.rating FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'DAN' AND T1.last_name = 'HARRIS' AND T3.length = 77 AND T3.replacement_cost = '9.99'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # The actor Dan Harris played in a 77 minute film with replacement cost of 9.99, what was the rating for that film?
9,154
How many films did actor Daryl Wahlberg appear in?
SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'DARYL' AND T2.last_name = 'WAHLBERG'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # How many films did actor Daryl Wahlberg appear in?
9,155
Sherri Rhodes rented a film at 12:27:27 on 2005/7/28, when did she/he return that film?
SELECT T2.return_date FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'SHERRI' AND T1.last_name = 'RHODES' AND T2.rental_date = '2005-07-28 12:27:27'
movie_3
Database Schema: actor (actor_id integer, first_name text, last_name text, last_update datetime, , PRIMARY KEY(actor_id), ) #address (address_id integer, address text, address2 text, district text, city_id integer, postal_code text, phone text, last_update datetime, , PRIMARY KEY(address_id), FOREIGN KEY(city_id) REFERENCES city(city_id)) #category (category_id integer, name text, last_update datetime, , PRIMARY KEY(category_id), ) #city (city_id integer, city text, country_id integer, last_update datetime, , PRIMARY KEY(city_id), FOREIGN KEY(country_id) REFERENCES country(country_id)) #country (country_id integer, country text, last_update datetime, , PRIMARY KEY(country_id), ) #customer (customer_id integer, store_id integer, first_name text, last_name text, email text, address_id integer, active integer, create_date datetime, last_update datetime, , PRIMARY KEY(customer_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #film (film_id integer, title text, description text, release_year text, language_id integer, original_language_id integer, rental_duration integer, rental_rate real, length integer, replacement_cost real, rating text, special_features text, last_update datetime, , PRIMARY KEY(film_id), FOREIGN KEY(language_id) REFERENCES language(language_id), FOREIGN KEY(original_language_id) REFERENCES language(language_id)) #film_actor (actor_id integer, film_id integer, last_update datetime, , PRIMARY KEY(actor_id), PRIMARY KEY(film_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(actor_id) REFERENCES actor(actor_id)) #film_category (film_id integer, category_id integer, last_update datetime, , PRIMARY KEY(film_id), PRIMARY KEY(category_id), FOREIGN KEY(category_id) REFERENCES category(category_id), FOREIGN KEY(film_id) REFERENCES film(film_id)) #film_text (film_id integer, title text, description text, , PRIMARY KEY(film_id), ) #inventory (inventory_id integer, film_id integer, store_id integer, last_update datetime, , PRIMARY KEY(inventory_id), FOREIGN KEY(film_id) REFERENCES film(film_id), FOREIGN KEY(store_id) REFERENCES store(store_id)) #language (language_id integer, name text, last_update datetime, , PRIMARY KEY(language_id), ) #payment (payment_id integer, customer_id integer, staff_id integer, rental_id integer, amount real, payment_date datetime, last_update datetime, , PRIMARY KEY(payment_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id), FOREIGN KEY(rental_id) REFERENCES rental(rental_id)) #rental (rental_id integer, rental_date datetime, inventory_id integer, customer_id integer, return_date datetime, staff_id integer, last_update datetime, , PRIMARY KEY(rental_id), FOREIGN KEY(staff_id) REFERENCES staff(staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY(customer_id) REFERENCES customer(customer_id)) #staff (staff_id integer, first_name text, last_name text, address_id integer, picture blob, email text, store_id integer, active integer, username text, password text, last_update datetime, , PRIMARY KEY(staff_id), FOREIGN KEY(store_id) REFERENCES store(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id)) #store (store_id integer, manager_staff_id integer, address_id integer, last_update datetime, , PRIMARY KEY(store_id), FOREIGN KEY(address_id) REFERENCES address(address_id), FOREIGN KEY(manager_staff_id) REFERENCES staff(staff_id)) # Sherri Rhodes rented a film at 12:27:27 on 2005/7/28, when did she/he return that film?
9,156