question
stringlengths
24
325
sql
stringlengths
30
804
db_id
stringclasses
63 values
prompt
stringlengths
308
18.9k
question_id
int64
167
9.43k
difficulty
stringclasses
1 value
How many cars are there on train no.1?
SELECT COUNT(id) FROM cars WHERE train_id = 1
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many cars are there on train no.1?
691
What is the shape of the tail car on train no.1?
SELECT shape FROM cars WHERE train_id = 1 AND position = 4
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What is the shape of the tail car on train no.1?
692
Please list the IDs of all the trains with at least one car in a non-regular shape.
SELECT train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the IDs of all the trains with at least one car in a non-regular shape.
693
How many cars on train no.1 have the roof open?
SELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many cars on train no.1 have the roof open?
694
Please list the IDs of all the cars on train no.1 that have 2 wheels.
SELECT id FROM cars WHERE train_id = 1 AND wheels = 2
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the IDs of all the cars on train no.1 that have 2 wheels.
695
Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?
SELECT SUM(CASE WHEN T1.shape IN ('bucket', 'elipse') THEN 1 ELSE 0 end)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?
696
Please list the IDs of all the trains that run in the east direction and have less than 4 cars.
SELECT T1.id FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'east' AND T2.carsNum < 4
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the IDs of all the trains that run in the east direction and have less than 4 cars.
697
Please list the IDs of all the cars with double sides on trains that run in the west direction.
SELECT T1.id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.sides = 'double'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the IDs of all the cars with double sides on trains that run in the west direction.
698
Among the trains that run in the east direction, how many of them have more than 2 long cars?
SELECT SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the trains that run in the east direction, how many of them have more than 2 long cars?
699
Please list the directions in which the trains with at least one empty-loaded car run.
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the directions in which the trains with at least one empty-loaded car run.
700
In which direction does the train with an ellipse-shape car run?
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # In which direction does the train with an ellipse-shape car run?
701
What is the total number of short cars on all the trains that run in the east direction?
SELECT SUM(CASE WHEN T1.len = 'short' then 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What is the total number of short cars on all the trains that run in the east direction?
702
Please list the shapes of all the head cars on the trains that run in the east direction.
SELECT T1.shape FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.position = 1 GROUP BY T1.shape
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the shapes of all the head cars on the trains that run in the east direction.
703
How many cars on a train that runs in the east direction have a flat roof?
SELECT SUM(CASE WHEN T1.roof = 'flat' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many cars on a train that runs in the east direction have a flat roof?
704
Among the cars on a train that runs in the east direction, how many of them have a flat roof and a circle load shape?
SELECT SUM(CASE WHEN T1.load_shape = 'circle' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.roof = 'flat'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the cars on a train that runs in the east direction, how many of them have a flat roof and a circle load shape?
705
Trains that run in which direction have more rectangle-shaped cars in total?
SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS rectCarsNum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id ORDER BY T2.rectCarsNum DESC
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Trains that run in which direction have more rectangle-shaped cars in total?
706
Please list the directions in which the trains with 4 short cars run.
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.len = 'short' AND T1.position = 4
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Please list the directions in which the trains with 4 short cars run.
707
What is the average number of cars on trains that run in the east direction?
SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What is the average number of cars on trains that run in the east direction?
708
Among the trains that have at least one non-regular shaped car, what is the percentage of it running in the east direction?
SELECT CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T1.train_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape IN ('bucket', 'ellipse')
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the trains that have at least one non-regular shaped car, what is the percentage of it running in the east direction?
709
How many short cars are in the shape of hexagon?
SELECT COUNT(id) FROM cars WHERE shape = 'hexagon' AND len = 'short'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many short cars are in the shape of hexagon?
710
How many trains are running west?
SELECT COUNT(id) FROM trains WHERE direction = 'west'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many trains are running west?
711
What are the load shapes of all the short ellipse cars?
SELECT load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What are the load shapes of all the short ellipse cars?
712
What are the ids of the train running east?
SELECT id FROM trains WHERE direction = 'east'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What are the ids of the train running east?
713
How many wheels do the long cars have?
SELECT SUM(wheels) FROM cars WHERE len = 'long'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many wheels do the long cars have?
714
Which direction do the majority of the trains are running?
SELECT direction FROM trains GROUP BY direction ORDER BY COUNT(id) DESC
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Which direction do the majority of the trains are running?
715
Among the trains running east, how many trains have at least 4 cars?
SELECT SUM(CASE WHEN T1.direction = 'east' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.carsNum >= 4
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the trains running east, how many trains have at least 4 cars?
716
Which direction do most of the trains with rectangle-shaped second cars run?
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'rectangle' GROUP BY T2.direction ORDER BY COUNT(T2.id) DESC LIMIT 1
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Which direction do most of the trains with rectangle-shaped second cars run?
717
How many trains running west have double sided cars in 3rd position?
SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 3 AND T2.direction = 'west' AND T1.sides = 'double' GROUP BY T1.train_id)as T
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many trains running west have double sided cars in 3rd position?
718
How many eastbound trains have rectangular-shaped head cars?
SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T2.direction = 'east' AND T1.shape = 'rectangle' GROUP BY T1.train_id)as T
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many eastbound trains have rectangular-shaped head cars?
719
Among the trains running west, how many trains have no more than one car with an open roof?
SELECT SUM(CASE WHEN T1.direction = 'west' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) FROM cars WHERE roof = 'none' GROUP BY train_id HAVING COUNT(id) = 1 ) AS T2 ON T1.id = T2.train_id
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the trains running west, how many trains have no more than one car with an open roof?
720
Which direction does the majority of the trains that have 3 cars are running?
SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id HAVING carsNum = 3 ) AS T2 ON T1.id = T2.train_id GROUP BY T1.direction
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Which direction does the majority of the trains that have 3 cars are running?
721
How many trains with fully loaded head cars are running east?
SELECT COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_num = 3
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many trains with fully loaded head cars are running east?
722
How many cars running east have double-sided tail cars?
SELECT COUNT(T1.id) FROM trains AS T1 INNER JOIN cars AS T2 ON T1.id = T2.train_id INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T3 ON T1.id = T3.train_id WHERE T1.direction = 'east' AND T2.position = T3.trailPosi AND T2.sides = 'double'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # How many cars running east have double-sided tail cars?
723
List all the directions of the trains that have empty cars.
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # List all the directions of the trains that have empty cars.
724
What is the direction of the train with a diamond-shaped load in its 2nd car?
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'diamond'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What is the direction of the train with a diamond-shaped load in its 2nd car?
725
Among the trains running west, how many trains have three-wheeled, jagged roof cars?
SELECT SUM(CASE WHEN T2.direction = 'west' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.wheels = 3 AND T1.roof = 'jagged'
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Among the trains running west, how many trains have three-wheeled, jagged roof cars?
726
Provide the directions for all the trains that have 2 or less cars.
SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.trailPosi <= 2
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # Provide the directions for all the trains that have 2 or less cars.
727
What is the percentage of all the trains with at least 4 cars? List the directions of the said trains.
SELECT CAST(COUNT(CASE WHEN T2.trailPosi >= 4 THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id UNION ALL SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars t GROUP BY train_id ) AS T2 ON T1.id = T2.train_id AND T2.trailPosi >= 4
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # What is the percentage of all the trains with at least 4 cars? List the directions of the said trains.
728
List all the load shapes of all head cars of each train and identify which load shape has the highest number. Calculate the percentage of the trains with the said head car that are running eas
SELECT DISTINCT T3.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC ) AS T3 UNION ALL SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 UNION ALL SELECT (CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.id)) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_shape = ( SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars AS T WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 )
trains
Database Schema: cars (id integer, train_id integer, position integer, shape text, len text, sides text, roof text, wheels integer, load_shape text, load_num integer, , PRIMARY KEY(id), FOREIGN KEY(train_id) REFERENCES trains(id)) #trains (id integer, direction text, , PRIMARY KEY(id), ) # List all the load shapes of all head cars of each train and identify which load shape has the highest number. Calculate the percentage of the trains with the said head car that are running eas
729
Please list the names of the characters in the movie Look Who's Talking.
SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Look Who''s Talking'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Please list the names of the characters in the movie Look Who's Talking.
730
Which character has the longest screen time in the movie Batman?
SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman' ORDER BY T2.screentime DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Which character has the longest screen time in the movie Batman?
731
Which actor played the role of Joker in the movie Batman?
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman' AND T2.`Character Name` = 'Joker'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Which actor played the role of Joker in the movie Batman?
732
Please list the names of the actors who played a role in the movie Batman.
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Please list the names of the actors who played a role in the movie Batman.
733
Which movie is the character Dr. Archibald 'Moonlight' Graham from?
SELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Dr. Archibald ''Moonlight'' Graham'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Which movie is the character Dr. Archibald 'Moonlight' Graham from?
734
Please list the names of the movies starring Tom Cruise.
SELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Please list the names of the movies starring Tom Cruise.
735
How many movies starring Morgan Freeman are suggested by parental guidance?
SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Morgan Freeman' AND T1.`MPAA Rating` = 'PG'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # How many movies starring Morgan Freeman are suggested by parental guidance?
736
Among the movies starring Tom Cruise, which one of them has the best quality?
SELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' ORDER BY T1.Rating DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Among the movies starring Tom Cruise, which one of them has the best quality?
737
What is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?
SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' AND T1.Title = 'Born on the Fourth of July'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?
738
Please list the names of all the characters played by Tom Cruise.
SELECT T1.`Character Name` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T2.Name = 'Tom Cruise'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Please list the names of all the characters played by Tom Cruise.
739
Among the actors who starred in the movie Batman, which one of them is the tallest?
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman' ORDER BY T3.`Height (Inches)` DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Among the actors who starred in the movie Batman, which one of them is the tallest?
740
How many movies star a male African American actor?
SELECT COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T2.Gender = 'Male' AND T2.Ethnicity = 'African American'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # How many movies star a male African American actor?
741
What is the average rating of all the movies starring Tom Cruise?
SELECT AVG(T1.Rating) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the average rating of all the movies starring Tom Cruise?
742
How much longer in percentage is the screen time of the most important character in Batman than the least important one?
SELECT (MAX(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) - MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL))) * 100 / MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # How much longer in percentage is the screen time of the most important character in Batman than the least important one?
743
Which movie had the biggest budget? Give the name of the movie.
SELECT Title FROM movie ORDER BY Budget DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Which movie had the biggest budget? Give the name of the movie.
744
What is the MPAA rating for the movie with the character named "Peter Quill" in it?
SELECT T1.`MPAA Rating` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Peter Quill'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the MPAA rating for the movie with the character named "Peter Quill" in it?
745
Give the name of the No.1 character in the credit list from the highest rating thriller movie.
SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.creditOrder = '1' AND T1.Genre = 'Thriller' ORDER BY T1.Rating DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Give the name of the No.1 character in the credit list from the highest rating thriller movie.
746
Who was the actor that played in the movie "Batman" with the longest screentime?
SELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID INNER JOIN movie AS T3 ON T3.MovieID = T1.MovieID WHERE T3.Title = 'Batman' ORDER BY T1.screentime DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Who was the actor that played in the movie "Batman" with the longest screentime?
747
How many movies has the highest networth actor acted in?
SELECT COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T2.NetWorth, ',', ''), '$', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(REPLACE(NetWorth, ',', ''), '$', '') AS REAL)) FROM actor)
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # How many movies has the highest networth actor acted in?
748
Who played the character named "Chanice Kobolowski"?
SELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Chanice Kobolowski'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Who played the character named "Chanice Kobolowski"?
749
When is the birthday of the actor who played "Sully"?
SELECT T2.`Date of Birth` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Sully'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # When is the birthday of the actor who played "Sully"?
750
Show the birth city of the actor who played "Gabriel Martin".
SELECT T2.`Birth City` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Gabriel Martin'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Show the birth city of the actor who played "Gabriel Martin".
751
Give the biography of the actor who played "Michael Moscovitz".
SELECT T2.Biography FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Michael Moscovitz'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Give the biography of the actor who played "Michael Moscovitz".
752
How tall is the actor who played "Lurch"?
SELECT T2.`Height (Inches)` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Lurch'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # How tall is the actor who played "Lurch"?
753
Show the No.3 character name in the credit list of the movie "G.I. Joe: The Rise of Cobra".
SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'G.I. Joe: The Rise of Cobra' AND T2.creditOrder = '3'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Show the No.3 character name in the credit list of the movie "G.I. Joe: The Rise of Cobra".
754
Who played the No.2 character in the credit list of the movie "American Hustle"?
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'American Hustle' AND T2.creditOrder = '2'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Who played the No.2 character in the credit list of the movie "American Hustle"?
755
Who played the No.1 character in the credit list of the movie which was released on "2015/10/26"?
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`Release Date` = '2015-10-26' AND T2.creditOrder = '1'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Who played the No.1 character in the credit list of the movie which was released on "2015/10/26"?
756
What is the percentage of the USA actors that showed up in the credit list of movie "Mrs. Doubtfire"?
SELECT CAST(SUM(CASE WHEN T3.`Birth Country` = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.`Birth Country`) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Mrs. Doubtfire'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the percentage of the USA actors that showed up in the credit list of movie "Mrs. Doubtfire"?
757
What is the percentage of the actors that showed up in the credit list of movie "Dawn of the Planet of the Apes" that were born after "1970/1/1"?
SELECT CAST(SUM(CASE WHEN T3.`Date of Birth` > '1970-01-01' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.`Date of Birth`) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Dawn of the Planet of the Apes'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the percentage of the actors that showed up in the credit list of movie "Dawn of the Planet of the Apes" that were born after "1970/1/1"?
758
List down the movie ID of movie with a budget of 15000000 and a rating between 7 to 8.
SELECT MovieID FROM movie WHERE Rating BETWEEN 7 AND 8 AND Budget = 15000000
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # List down the movie ID of movie with a budget of 15000000 and a rating between 7 to 8.
759
In rated PG movies, how many of them released in June 1990?
SELECT COUNT(*) FROM movie WHERE `MPAA Rating` = 'PG' AND `Release Date` LIKE '1990-06%'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # In rated PG movies, how many of them released in June 1990?
760
What is the name of male and white actor with actor ID 439?
SELECT Name FROM actor WHERE ActorID = 439 AND Gender = 'Male' AND Ethnicity = 'White'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the name of male and white actor with actor ID 439?
761
Among the actors born in New York City, list the genre of their movie with a rating greater than 5.
SELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.`Birth City` = 'New York City' AND T1.Rating > 5
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Among the actors born in New York City, list the genre of their movie with a rating greater than 5.
762
In romantic movies, how many of them starred by John Travolta?
SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Romance' AND T3.Name = 'John Travolta'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # In romantic movies, how many of them starred by John Travolta?
763
List the height and net worth of actors starred in Three Men and a Little Lady.
SELECT T3.`Height (Inches)`, T3.NetWorth FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Three Men and a Little Lady'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # List the height and net worth of actors starred in Three Men and a Little Lady.
764
What is the genre of PG rated movie starred by the actor with highest net worth?
SELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`MPAA Rating` = 'PG' ORDER BY CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the genre of PG rated movie starred by the actor with highest net worth?
765
What is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?
SELECT T3.NetWorth FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Misery' AND T3.`Height (Inches)` BETWEEN 60 AND 70 AND T3.Gender = 'Male'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?
766
Count the male actors born in USA that starred in Ghost.
SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Ghost' AND T3.Gender = 'Male' AND T3.`Birth Country` = 'USA'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Count the male actors born in USA that starred in Ghost.
767
What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget?
SELECT T1.`MPAA Rating`, T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Leonardo DiCaprio' ORDER BY T1.Budget DESC LIMIT 1
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget?
768
Among the actors starred in Die Hard 2, list their net worth and birth date of actors with a height between 60 to 65.
SELECT T3.NetWorth, T3.`Date of Birth` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Die Hard 2' AND T3.`Height (Inches)` BETWEEN 60 AND 65
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Among the actors starred in Die Hard 2, list their net worth and birth date of actors with a height between 60 to 65.
769
List the runtime of movies starred by an African-American actor born on December 28, 1954.
SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Ethnicity = 'African American' AND T3.`Date of Birth` = '1954-12-28'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # List the runtime of movies starred by an African-American actor born on December 28, 1954.
770
Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.
771
What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?
SELECT SUM(T1.Gross) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 375000000 AND T1.Rating < 7 AND T1.Genre = 'Comedy'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?
772
What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?
SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Jackie Chan' AND T1.Rating > 7
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?
773
Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
SELECT SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Drama'
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
774
List the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors listed.
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Gender = 'Female' AND T1.Title = 'Godzilla' AND T3.`Birth City` = 'Sherman Oaks' AND T3.`Height (Inches)` * 100 > ( SELECT AVG(`Height (Inches)`) FROM actor ) * 50
movie
Database Schema: actor (ActorID integer, Name text, Date of Birth date, Birth City text, Birth Country text, Height (Inches) integer, Biography text, Gender text, Ethnicity text, NetWorth text, , PRIMARY KEY(ActorID), ) #characters (MovieID integer, ActorID integer, Character Name text, creditOrder integer, pay text, screentime text, , PRIMARY KEY(MovieID), PRIMARY KEY(ActorID), FOREIGN KEY(MovieID) REFERENCES movie(MovieID), FOREIGN KEY(ActorID) REFERENCES actor(ActorID)) #movie (MovieID integer, Title text, MPAA Rating text, Budget integer, Gross integer, Release Date text, Genre text, Runtime integer, Rating real, Rating Count integer, Summary text, , PRIMARY KEY(MovieID), ) # List the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors listed.
775
How many tweets are in English?
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # How many tweets are in English?
776
Please list the texts of all the tweets that are reshared.
SELECT text FROM twitter WHERE IsReshare = 'TRUE'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Please list the texts of all the tweets that are reshared.
777
How many tweets are seen by more than 1000 unique users?
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # How many tweets are seen by more than 1000 unique users?
778
Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?
779
What is the text of the tweet that got the most `likes`?
SELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter )
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # What is the text of the tweet that got the most `likes`?
780
Please list all the cities in Argentina.
SELECT City FROM location WHERE City IS NOT NULL AND Country = 'Argentina'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Please list all the cities in Argentina.
781
How many tweets in total were posted by a user in Argentina?
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' LIMIT 1
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # How many tweets in total were posted by a user in Argentina?
782
Users in which city of Argentina post the most tweets?
SELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Users in which city of Argentina post the most tweets?
783
Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.IsReshare = 'TRUE'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?
784
Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment.
SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.City = 'Buenos Aires'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment.
785
From which country is the tweet with the most likes posted?
SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID ORDER BY T1.Likes DESC LIMIT 1
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # From which country is the tweet with the most likes posted?
786
Users in which country has posted more numbers of positive tweets, Argentina or Australia?
SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country IN ('Argentina', 'Australia') AND T1.Sentiment > 0 GROUP BY T2.Country ORDER BY COUNT(T1.TweetID) DESC LIMIT 1
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Users in which country has posted more numbers of positive tweets, Argentina or Australia?
787
Among all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.Weekday = 'Thursday'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Among all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?
788
Among all the users that have posted a tweet with over 1000 likes, how many of them are male?
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Likes > 10 AND T2.Gender = 'Male'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # Among all the users that have posted a tweet with over 1000 likes, how many of them are male?
789
How many tweets have the male users posted in total?
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'
social_media
Database Schema: location (LocationID integer, Country text, State text, StateCode text, City text, , PRIMARY KEY(LocationID), ) #twitter (TweetID text, Weekday text, Hour integer, Day integer, Lang text, IsReshare text, Reach integer, RetweetCount integer, Likes integer, Klout integer, Sentiment real, text text, LocationID integer, UserID text, , PRIMARY KEY(TweetID), FOREIGN KEY(LocationID) REFERENCES location(LocationID), FOREIGN KEY(UserID) REFERENCES user(UserID)) #user (UserID text, Gender text, , PRIMARY KEY(UserID), ) # How many tweets have the male users posted in total?
790