db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 0
673
| SQL
stringlengths 23
804
| question_id
int64 0
9.43k
| difficulty
stringclasses 1
value |
---|---|---|---|---|---|
trains
|
Please list the directions in which the trains with at least one empty-loaded car run.
|
at least one empty-loaded car run refers to load_num = 0
|
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0
| 700 | |
trains
|
In which direction does the train with an ellipse-shape car run?
|
shape = 'ellipse'
|
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'
| 701 | |
trains
|
What is the total number of short cars on all the trains that run in the east direction?
|
short cars refers to len = 'short'
|
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'
| 702 | |
trains
|
Please list the shapes of all the head cars on the trains that run in the east direction.
|
head cars refers to position = 1;
|
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
| 703 | |
trains
|
How many cars on a train that runs in the east direction have a flat roof?
|
flat roof refers to roof = 'flat'
|
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'
| 704 | |
trains
|
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?
|
flat roof refers to roof = 'flat'; load_shape = 'circle'
|
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'
| 705 | |
trains
|
Trains that run in which direction have more rectangle-shaped cars in total?
|
more rectangle-shaped cars refers to MAX(rectCarsNum)
|
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
| 706 | |
trains
|
Please list the directions in which the trains with 4 short cars run.
|
short refers to len = 'short'; 4 cars run refers to position = 4
|
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
| 707 | |
trains
|
What is the average number of cars on trains that run in the east direction?
|
calculation = DIVIDE(count(id), count(train_id))
|
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'
| 708 | |
trains
|
Among the trains that have at least one non-regular shaped car, what is the percentage of it running in the east direction?
|
non-regular shaped car refers to shape in ('bucket', 'ellipse'); calculation = MULTIPLY(DIVIDE(count(direction = 'east' then train_id)), count(train_id), 100)
|
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')
| 709 | |
trains
|
How many short cars are in the shape of hexagon?
|
short cars refers to len = 'short'; in the shape of hexagon refers to shape = 'hexagon'
|
SELECT COUNT(id) FROM cars WHERE shape = 'hexagon' AND len = 'short'
| 710 | |
trains
|
How many trains are running west?
|
west is a direction
|
SELECT COUNT(id) FROM trains WHERE direction = 'west'
| 711 | |
trains
|
What are the load shapes of all the short ellipse cars?
|
short refers to len = 'short'; ellipse cars refers to shape = 'ellipse'
|
SELECT load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short'
| 712 | |
trains
|
What are the ids of the train running east?
|
east is a direction
|
SELECT id FROM trains WHERE direction = 'east'
| 713 | |
trains
|
How many wheels do the long cars have?
|
long cars refers to len = 'long'
|
SELECT SUM(wheels) FROM cars WHERE len = 'long'
| 714 | |
trains
|
Which direction do the majority of the trains are running?
|
majority of train refers to MAX(count(id))
|
SELECT direction FROM trains GROUP BY direction ORDER BY COUNT(id) DESC
| 715 | |
trains
|
Among the trains running east, how many trains have at least 4 cars?
|
east is a direction; at least 4 cars refers to carsNum > = 4
|
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
| 716 | |
trains
|
Which direction do most of the trains with rectangle-shaped second cars run?
|
most of the trains refers to MAX(count(id)); second cars refers to position = 2
|
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
| 717 | |
trains
|
How many trains running west have double sided cars in 3rd position?
|
west is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3
|
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
| 718 | |
trains
|
How many eastbound trains have rectangular-shaped head cars?
|
eastbound refers to direction = 'east'; head cars refers to position = 1
|
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
| 719 | |
trains
|
Among the trains running west, how many trains have no more than one car with an open roof?
|
running west refers to direction = 'west'; open roof refers to roof = 'none'
|
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
| 720 | |
trains
|
Which direction does the majority of the trains that have 3 cars are running?
|
3 cars refers to carsNum = 3
|
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
| 721 | |
trains
|
How many trains with fully loaded head cars are running east?
|
fully loaded refers to load_num = 3; head cars refers to position = 1
|
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
| 722 | |
trains
|
How many cars running east have double-sided tail cars?
|
east is an direction; double-sided refers to sides = 'double'; tail refers to carsposition = trailPosi
|
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'
| 723 | |
trains
|
List all the directions of the trains that have empty cars.
|
empty cars refers to load_num = 0
|
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0
| 724 | |
trains
|
What is the direction of the train with a diamond-shaped load in its 2nd car?
|
2nd car refers to position = 2
|
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'
| 725 | |
trains
|
Among the trains running west, how many trains have three-wheeled, jagged roof cars?
|
west is an direction; three-wheeled refers to wheels = 3; jagged roof refers to roof = 'jagged'
|
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'
| 726 | |
trains
|
Provide the directions for all the trains that have 2 or less cars.
|
2 or less cars refers to trailPosi < = 2
|
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
| 727 | |
trains
|
What is the percentage of all the trains with at least 4 cars? List the directions of the said trains.
|
at least 4 cars refers to trailPosi > = 4; calculation = MULTIPLY(DIVIDE(count(trailPosi > = 4 then id), count(id)), 100)
|
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
| 728 | |
trains
|
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
|
which load shape has the highest number refers to MAX(load_shape); head car refers to position = 1; east is a direction; calculation = MULTIPLY(DIVIDE(count(direction = 'east' where MAX(load_shape) where position = 1 then id), count(id)), 100)
|
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 )
| 729 | |
movie
|
Please list the names of the characters in the movie Look Who's Talking.
|
movie Look Who's Talking refers to title = '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'
| 730 | |
movie
|
Which character has the longest screen time in the movie Batman?
|
longest screen time refers to max(screentime); movie Batman refers to title = '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
| 731 | |
movie
|
Which actor played the role of Joker in the movie Batman?
|
role of Joker refers to character_name = 'Joker'; movie Batman refers to title = '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'
| 732 | |
movie
|
Please list the names of the actors who played a role in the movie Batman.
|
movie Batman refers to title = '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'
| 733 | |
movie
|
Which movie is the character Dr. Archibald 'Moonlight' Graham from?
|
movie name refers to title; character Dr. Archibald 'Moonlight' Graham refers to character_name = 'Dr. Archibald 'Moonlight' Graham'
|
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'
| 734 | |
movie
|
Please list the names of the movies starring Tom Cruise.
|
movie name refers to title; starring Tom Cruise refers to name = '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'
| 735 | |
movie
|
How many movies starring Morgan Freeman are suggested by parental guidance?
|
'suggested by parental guidance' refers to mpaa_rating = 'PG'
|
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'
| 736 | |
movie
|
Among the movies starring Tom Cruise, which one of them has the best quality?
|
starring Tom Cruise refers to name = 'Tom Cruise'; best quality refers to max(rating)
|
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
| 737 | |
movie
|
What is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?
|
played by Tom Cruise refers to name = 'Tom Cruise'; movie Born on the Fourth of July refers to title = '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'
| 738 | |
movie
|
Please list the names of all the characters played by Tom Cruise.
|
played by Tom Cruise refers to name = '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'
| 739 | |
movie
|
Among the actors who starred in the movie Batman, which one of them is the tallest?
|
movie Batman refers to title = 'Batman'; tallest refers to max(height_inches)
|
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
| 740 | |
movie
|
How many movies star a male African American actor?
|
male refers to gender = 'Male'; African American refers to ethnicity = 'African American'
|
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'
| 741 | |
movie
|
What is the average rating of all the movies starring Tom Cruise?
|
starring Tom Cruise refers to name = 'Tom Cruise'; average rating = divide(sum(rating where name = 'Tom Cruise'), count(movieid where name = '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'
| 742 | |
movie
|
How much longer in percentage is the screen time of the most important character in Batman than the least important one?
|
most important character refers to max(screentime); least important character refers to min(screentime); movie Batman refers to title = 'Batman'; percentage = divide(subtract(max(screentime) , min(screentime)) , min(screentime)) * 100%
|
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'
| 743 | |
movie
|
Which movie had the biggest budget? Give the name of the movie.
|
biggest budget refers to max(Budget); name of the movie refers to Title
|
SELECT Title FROM movie ORDER BY Budget DESC LIMIT 1
| 744 | |
movie
|
What is the MPAA rating for the movie with the character named "Peter Quill" in it?
|
MPAA rating = 'G' means General audiences; MPAA rating = 'PG' means Parental guidance suggested; MPAA rating = 'R'means Restricted; MPAA rating = 'X' means No one under 17 admitted
|
SELECT T1.`MPAA Rating` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Peter Quill'
| 745 | |
movie
|
Give the name of the No.1 character in the credit list from the highest rating thriller movie.
|
No.1 character in the credit list refers to creditOrder = '1'; highest rating refers to max(rating); thriller movie refers to Genre = 'Thriller'
|
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
| 746 | |
movie
|
Who was the actor that played in the movie "Batman" with the longest screentime?
|
movie "Batman" refers to Title = 'Batman'; longest screentime refers to max(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
| 747 | |
movie
|
How many movies has the highest networth actor acted in?
|
highest networth refers to max(networth)
|
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)
| 748 | |
movie
|
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'
| 749 | ||
movie
|
When is the birthday of the actor who played "Sully"?
|
birthday refers to Date of Birth; "Sully" refers to Character Name = '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'
| 750 | |
movie
|
Show the birth city of the actor who played "Gabriel Martin".
|
"Gabriel Martin" refers to Character Name = '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'
| 751 | |
movie
|
Give the biography of the actor who played "Michael Moscovitz".
|
"Michael Moscovitz" refers to Character Name = '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'
| 752 | |
movie
|
How tall is the actor who played "Lurch"?
|
tall refers to Height (Inches); "Lurch" refers to Character Name = 'Lurch'
|
SELECT T2.`Height (Inches)` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Lurch'
| 753 | |
movie
|
Show the No.3 character name in the credit list of the movie "G.I. Joe: The Rise of Cobra".
|
No.3 character refers to creditOrder = '3'; movie "G.I. Joe: The Rise of Cobra" refers to Title = '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'
| 754 | |
movie
|
Who played the No.2 character in the credit list of the movie "American Hustle"?
|
No.2 character refers to creditOrder = '2'; movie "American Hustle" refers to Title = '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'
| 755 | |
movie
|
Who played the No.1 character in the credit list of the movie which was released on "2015/10/26"?
|
No.1 character refers to creditOrder = '1'; released on "2015/10/26" refers to Release Date = '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'
| 756 | |
movie
|
What is the percentage of the USA actors that showed up in the credit list of movie "Mrs. Doubtfire"?
|
USA actors refers to Birth Country = 'USA'; movie "Mrs. Doubtfire" refers to Title = 'Mrs. Doubtfire'; percentage = divide(count(ActorID where Birth Country = 'USA'), count(ActorID)) * 100%
|
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'
| 757 | |
movie
|
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"?
|
movie "Dawn of the Planet of the Apes" refers to Title = 'Dawn of the Planet of the Apes'; born after "1970/1/1" refers to Date of Birth > '1970/1/1'; percentage = divide(count(ActorID where Date of Birth > '1970/1/1'), count(ActorID))*100%
|
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'
| 758 | |
movie
|
List down the movie ID of movie with a budget of 15000000 and a rating between 7 to 8.
|
a budget of 15000000 refers to Budget = 15000000; rating between 7 to 8 refers to Rating BETWEEN 7 and 8
|
SELECT MovieID FROM movie WHERE Rating BETWEEN 7 AND 8 AND Budget = 15000000
| 759 | |
movie
|
In rated PG movies, how many of them released in June 1990?
|
rated PG refers to MPAA Rating = 'PG'; released in June 1990 refers to Release Date BETWEEN '1990-06-01' and '1990-06-30'
|
SELECT COUNT(*) FROM movie WHERE `MPAA Rating` = 'PG' AND `Release Date` LIKE '1990-06%'
| 760 | |
movie
|
What is the name of male and white actor with actor ID 439?
|
male refers to Gender = 'Male'; white refers to Ethnicity = 'White'
|
SELECT Name FROM actor WHERE ActorID = 439 AND Gender = 'Male' AND Ethnicity = 'White'
| 761 | |
movie
|
Among the actors born in New York City, list the genre of their movie with a rating greater than 5.
|
born in New York City refers to Birth City = 'New York City'; rating greater than 5 refers to Rating > 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
| 762 | |
movie
|
In romantic movies, how many of them starred by John Travolta?
|
romantic movies refers to Genre = 'Romance'; starred by John Travolta refers to Name = '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'
| 763 | |
movie
|
List the height and net worth of actors starred in Three Men and a Little Lady.
|
Three Men and a Little Lady refers to Title = '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'
| 764 | |
movie
|
What is the genre of PG rated movie starred by the actor with highest net worth?
|
PG rated refers to MPAA Rating = 'PG'; highest net worth refers to max(NetWorth)
|
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
| 765 | |
movie
|
What is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?
|
Misery refers to Title = 'Misery'; height ranging from 60 to 70 inches refers to Height (Inches) BETWEEN 60 and 70
|
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'
| 766 | |
movie
|
Count the male actors born in USA that starred in Ghost.
|
male refers to Gender = 'Male'; born in USA refers to Birth Country = 'USA'; Ghost refers to Title = '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'
| 767 | |
movie
|
What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget?
|
starred by Leonardo DiCaprio refers to Name = 'Leonardo Dicaprio'; highest budget refers to max(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
| 768 | |
movie
|
Among the actors starred in Die Hard 2, list their net worth and birth date of actors with a height between 60 to 65.
|
Die Hard 2 refers to Title = 'Die Hard 2'; height between 60 to 65 refers to Height (Inches) BETWEEN 60 AND 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
| 769 | |
movie
|
List the runtime of movies starred by an African-American actor born on December 28, 1954.
|
African-American refers to Ethnicity = 'African American'; born on December 28 1954 refers to Date of Birth = '1954-12-28'
|
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'
| 770 | |
movie
|
Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.
|
actor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama'
|
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'
| 771 | |
movie
|
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?
|
comedy movie refers to Genre = 'Comedy'; rating lower than 7 refers to Rating < 7; net worth greater than $375,000,000.00 refers to NetWorth > '$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'
| 772 | |
movie
|
What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?
|
starred by Jackie Chan refers to Name = 'Jackie Chan'; rating greater than 7 refers to Rating > 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
| 773 | |
movie
|
Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
|
drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%
|
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'
| 774 | |
movie
|
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.
|
actress refers to Gender = 'Female'; born in Sherman Oaks refers to Birth City = 'Sherman Oaks'; movie Bruce Almighty refers to Title = 'Bruce Almighty'; height greater than the 50% of average height refers to Height (Inches) > multiply(avg(Height (Inches)), 0.5)
|
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
| 775 | |
social_media
|
How many tweets are in English?
|
english is the language and refers to Lang = 'en'
|
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en'
| 776 | |
social_media
|
Please list the texts of all the tweets that are reshared.
|
reshared refers to Isreshare = 'TRUE'
|
SELECT text FROM twitter WHERE IsReshare = 'TRUE'
| 777 | |
social_media
|
How many tweets are seen by more than 1000 unique users?
|
seen by more than 1000 unique users refers to Reach > 1000
|
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000
| 778 | |
social_media
|
Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?
|
positive sentiment refers to Sentiment > 0; posted on Thursday refers to Weekday = 'Thursday'
|
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'
| 779 | |
social_media
|
What is the text of the tweet that got the most `likes`?
|
got the most like refers to Max(Likes)
|
SELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter )
| 780 | |
social_media
|
Please list all the cities in Argentina.
|
"Argentina" is the Country
|
SELECT City FROM location WHERE City IS NOT NULL AND Country = 'Argentina'
| 781 | |
social_media
|
How many tweets in total were posted by a user in Argentina?
|
"Argentina" is the Country
|
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' LIMIT 1
| 782 | |
social_media
|
Users in which city of Argentina post the most tweets?
|
"Argentina" is the Country; post the most tweets refers to Max(Count(TweetID))
|
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
| 783 | |
social_media
|
Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?
|
reshared refers to Isreshare = 'TRUE'; 'Buenos Aires' is the City
|
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'
| 784 | |
social_media
|
Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment.
|
"Buenos Aires" is the City; positive sentiment refers to Sentiment > 0
|
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'
| 785 | |
social_media
|
From which country is the tweet with the most likes posted?
|
tweet with the most likes refers to Max(Likes)
|
SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID ORDER BY T1.Likes DESC LIMIT 1
| 786 | |
social_media
|
Users in which country has posted more numbers of positive tweets, Argentina or Australia?
|
"Argentina" and "Australia" are both Country; positive tweets refers to Sentiment > 0; Country posted more number of tweets refers to Country where Max(Count(TweetID))
|
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
| 787 | |
social_media
|
Among all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?
|
"Buenos Aires" is the City; posted on Thursday refers to Weekday = 'Thursday'
|
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'
| 788 | |
social_media
|
Among all the users that have posted a tweet with over 1000 likes, how many of them are male?
|
over 1000 likes refers to Likes > 1000; 'Male' is the Gender of user
|
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'
| 789 | |
social_media
|
How many tweets have the male users posted in total?
|
male users refers to Gender = 'Male'; total tweets refers to Count(TweetID)
|
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'
| 790 | |
social_media
|
What is the gender of the user who has posted the tweet that is seen by the most number of unique users?
|
seen by the most number of unique users refers to Max(Reach)
|
SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Reach DESC LIMIT 1
| 791 | |
social_media
|
How many tweets are posted by male users in Argentina?
|
"Argentina" is the Country; male user refers to Gender = 'Male'
|
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T3.Gender = 'Male' AND T2.Country = 'Argentina'
| 792 | |
social_media
|
Please list the texts of all the tweets posted by male users from Buenos Aires.
|
"Buenos Aires" is the City; male user refers to Gender = 'Male'
|
SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T2 ON T2.UserID = T1.UserID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T2.City = 'Buenos Aires' AND T3.Gender = 'Male'
| 793 | |
social_media
|
What is the average number of tweets posted by the users in a city in Argentina?
|
"Argentina" is the Country; average number of tweets in a city = Divide (Count(TweetID where Country = 'Argentina'), Count (City))
|
SELECT SUM(CASE WHEN T2.City = 'Buenos Aires' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS avg FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'
| 794 | |
social_media
|
Among all the tweets with a positive sentiment, what is the percentage of those posted by a male user?
|
positive sentiment refers to Sentiment > 0; male user refers to Gender = 'Male'; percentage = Divide (Count(TweetID where Gender = 'Male'), Count (TweetID)) * 100
|
SELECT SUM(CASE WHEN T2.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS per FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Sentiment > 0
| 795 | |
social_media
|
Give the number of users who do not show their genders.
|
do not show their gender refers to Gender = 'Unknown'
|
SELECT COUNT(UserID) AS user_number FROM user WHERE Gender = 'Unknown'
| 796 | |
social_media
|
State the number of states in the United Kingdom.
|
"United Kingdom" is the Country
|
SELECT COUNT(State) AS State_number FROM location WHERE Country = 'United Kingdom'
| 797 | |
social_media
|
What is the code of Gwynedd State?
|
code refers to StateCode
|
SELECT DISTINCT StateCode FROM location WHERE State = 'Gwynedd'
| 798 | |
social_media
|
Give the location id of West Sussex State.
|
SELECT DISTINCT LocationID FROM location WHERE State = 'West Sussex'
| 799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.