Chinastark/bird_dataset huggingface dataset:
Database: trains
Note: train no.1 refers to train_id = 1;
Question: How many cars are there on train no.1?
SQL: SELECT count(id) FROM cars WHERE train_id = 1
Database: trains
Note: train no.1 refers to train_id = 1; tail car refers to position = 4;
Question: What is the shape of the tail car on train no.1?
SQL: SELECT shape FROM cars WHERE train_id = 1 AND POSITION = 4
Database: trains
Note: non-regular shape refers to shape in ('elipse', 'bucket');
Question: Please list the IDs of all the trains with at least one car in a non-regular shape.
SQL: SELECT train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id
Database: trains
Note: train no. 1 refers to train_id = 1; roof open refers to roof = 'none';
Question: How many cars on train no.1 have the roof open?
SQL: SELECT count(id) FROM cars WHERE train_id = 1 AND roof = 'none'
Database: trains
Note: train no.1 refers to train_id = 1; 2 wheels refers to wheels = 2;
Question: Please list the IDs of all the cars on train no.1 that have 2 wheels.
SQL: SELECT id FROM cars WHERE train_id = 1 AND wheels = 2
Database: trains
Note: non-regular shape refers to shape in ('elipse', 'bucket');
Question: Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?
SQL: SELECT sum(CASE WHEN cars.shape IN ('bucket', 'elipse') THEN 1 ELSE 0 END)AS COUNT FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east'
Database: trains
Note: less than 4 cars refers to carsNum < 4;
Question: Please list the IDs of all the trains that run in the east direction and have less than 4 cars.
SQL: SELECT trains.id FROM trains INNER JOIN ( SELECT train_id, max(POSITION) AS carsnum FROM cars GROUP BY train_id ) AS t2 ON trains.id = t2.train_id WHERE trains.direction = 'east' AND t2.carsnum < 4
Database: trains
Note: double sides on trains refers to sides = 'double';
Question: Please list the IDs of all the cars with double sides on trains that run in the west direction.
SQL: SELECT cars.id FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east' AND cars.sides = 'double'
Database: trains
Note: more than 2 long cars refers to longcarsNum > 2;
Question: Among the trains that run in the east direction, how many of them have more than 2 long cars?
SQL: SELECT sum(CASE WHEN t2.longcarsnum > 2 THEN 1 ELSE 0 END)AS COUNT FROM trains INNER JOIN ( SELECT train_id, count(id) AS longcarsnum FROM cars WHERE LEN = 'long' GROUP BY train_id ) AS t2 ON trains.id = t2.train_id WHERE trains.direction = 'west'
Database: trains
Note: at least one empty-loaded car run refers to load_num = 0;
Question: Please list the directions in which the trains with at least one empty-loaded car run.
SQL: SELECT trains.direction FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.load_num = 0
Database: trains
Note: shape = 'ellipse';
Question: In which direction does the train with an ellipse-shape car run?
SQL: SELECT trains.direction FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.shape = 'ellipse'
Database: trains
Note: short cars refers to len = 'short';
Question: What is the total number of short cars on all the trains that run in the east direction?
SQL: SELECT sum(CASE WHEN cars.len = 'short' THEN 1 ELSE 0 END)AS COUNT FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east'
Database: trains
Note: head cars refers to position = 1;
Question: Please list the shapes of all the head cars on the trains that run in the east direction.
SQL: SELECT cars.shape FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east' AND cars.position = 1 GROUP BY cars.shape
Database: trains
Note: flat roof refers to roof = 'flat';
Question: How many cars on a train that runs in the east direction have a flat roof?
SQL: SELECT sum(CASE WHEN cars.roof = 'flat' THEN 1 ELSE 0 END)AS COUNT FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east'
Database: trains
Note: flat roof refers to roof = 'flat'; load_shape = 'circle';
Question: 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?
SQL: SELECT sum(CASE WHEN cars.load_shape = 'circle' THEN 1 ELSE 0 END)AS COUNT FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east' AND cars.roof = 'flat'
Database: trains
Note: more rectangle-shaped cars refers to MAX(rectcarsNum);
Question: Trains that run in which direction have more rectangle-shaped cars in total?
SQL: SELECT trains.direction FROM trains INNER JOIN ( SELECT train_id, count(id) AS rectcarsnum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS t2 ON trains.id = t2.train_id ORDER BY t2.rectcarsnum DESC
Database: trains
Note: short refers to len = 'short'; 4 cars run refers to position = 4;
Question: Please list the directions in which the trains with 4 short cars run.
SQL: SELECT trains.direction FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.len = 'short' AND cars.position = 4
Database: trains
Note: calculation = DIVidE(count(id), count(train_id));
Question: What is the average number of cars on trains that run in the east direction?
SQL: SELECT cast(count(cars.id) AS REAL) / count(DISTINCT cars.train_id) FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE trains.direction = 'east'
Database: trains
Note: non-regular shaped car refers to shape in ('bucket', 'ellipse'); calculation = MULTIPLY(DIVidE(count(direction = 'east' then train_id)), count(train_id), 100);
Question: Among the trains that have at least one non-regular shaped car, what is the percentage of it running in the east direction?
SQL: SELECT cast(count(DISTINCT CASE WHEN trains.direction = 'east' THEN cars.train_id ELSE NULL END) AS REAL) * 100 / count(DISTINCT cars.train_id) FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.shape IN ('bucket', 'ellipse')
Database: trains
Note: short cars refers to len = 'short'; in the shape of hexagon refers to shape = 'hexagon';
Question: How many short cars are in the shape of hexagon?
SQL: SELECT count(id) FROM cars WHERE shape = 'hexagon' AND LEN = 'short'
Database: trains
Note: west is a direction;
Question: How many trains are running west?
SQL: SELECT count(id) FROM trains WHERE direction = 'west'
Database: trains
Note: short refers to len = 'short'; ellipse cars refers to shape = 'ellipse';
Question: What are the load shapes of all the short ellipse cars?
SQL: SELECT load_shape FROM cars WHERE shape = 'ellipse' AND LEN = 'short'
Database: trains
Note: east is a direction;
Question: What are the ids of the train running east?
SQL: SELECT id FROM trains WHERE direction = 'east'
Database: trains
Note: long cars refers to len = 'long';
Question: How many wheels do the long cars have?
SQL: SELECT sum(wheels) FROM cars WHERE LEN = 'long'
Database: trains
Note: majority of train refers to MAX(count(id));
Question: Which direction do the majority of the trains are running?
SQL: SELECT direction FROM trains GROUP BY direction ORDER BY count(id) DESC
Database: trains
Note: east is a direction; at least 4 cars refers to carsNum >= 4;
Question: Among the trains running east, how many trains have at least 4 cars?
SQL: SELECT sum(CASE WHEN trains.direction = 'east' THEN 1 ELSE 0 END)AS COUNT FROM trains INNER JOIN ( SELECT train_id, count(id) AS carsnum FROM cars GROUP BY train_id ) AS t2 ON trains.id = t2.train_id WHERE t2.carsnum >= 4
Database: trains
Note: most of the trains refers to MAX(count(id)); second cars refers to position = 2;
Question: Which direction do most of the trains with rectangle-shaped second cars run?
SQL: SELECT trains.direction FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.position = 2 AND cars.shape = 'rectangle' GROUP BY trains.direction ORDER BY count(trains.id) DESC LIMIT 1
Database: trains
Note: west is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3;
Question: How many trains running west have double sided cars in 3rd position?
SQL: SELECT count(t.train_id) FROM (SELECT cars.train_id FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.position = 3 AND trains.direction = 'west' AND cars.sides = 'double' GROUP BY cars.train_id)AS t
Database: trains
Note: eastbound refers to direction = 'east'; head cars refers to position = 1;
Question: How many eastbound trains have rectangular-shaped head cars?
SQL: SELECT count(t.train_id) FROM (SELECT cars.train_id FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.position = 1 AND trains.direction = 'east' AND cars.shape = 'rectangle' GROUP BY cars.train_id)AS t
Database: trains
Note: running west refers to direction = 'west'; open roof refers to roof = 'none';
Question: Among the trains running west, how many trains have no more than one car with an open roof?
SQL: SELECT sum(CASE WHEN trains.direction = 'west' THEN 1 ELSE 0 END)AS COUNT FROM trains INNER JOIN ( SELECT train_id, count(id) FROM cars WHERE roof = 'none' GROUP BY train_id HAVING count(id) = 1 ) AS t2 ON trains.id = t2.train_id
Database: trains
Note: 3 cars refers to carsNum = 3;
Question: Which direction does the majority of the trains that have 3 cars are running?
SQL: SELECT trains.direction FROM trains INNER JOIN ( SELECT train_id, count(id) AS carsnum FROM cars GROUP BY train_id HAVING carsnum = 3 ) AS t2 ON trains.id = t2.train_id GROUP BY trains.direction
Database: trains
Note: fully loaded refers to load_num = 3; head cars refers to position = 1;
Question: How many trains with fully loaded head cars are running east?
SQL: SELECT count(DISTINCT cars.train_id) FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.position = 1 AND cars.load_num = 3
Database: trains
Note: east is an direction; double-sided refers to sides = 'double'; tail refers to carsposition = trailPosi;
Question: How many cars running east have double-sided tail cars?
SQL: SELECT count(trains.id) FROM trains INNER JOIN cars ON trains.id = cars.train_id INNER JOIN ( SELECT train_id, max(POSITION) AS trailposi FROM cars GROUP BY train_id ) AS t3 ON trains.id = t3.train_id WHERE trains.direction = 'east' AND cars.position = t3.trailposi AND cars.sides = 'double'
Database: trains
Note: empty cars refers to load_num = 0;
Question: List all the directions of the trains that have empty cars.
SQL: SELECT trains.direction FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.load_num = 0
Database: trains
Note: 2nd car refers to position = 2;
Question: What is the direction of the train with a diamond-shaped load in its 2nd car?
SQL: SELECT trains.direction FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.position = 2 AND cars.shape = 'diamond'
Database: trains
Note: west is an direction; three-wheeled refers to wheels = 3; jagged roof refers to roof = 'jagged';
Question: Among the trains running west, how many trains have three-wheeled, jagged roof cars?
SQL: SELECT sum(CASE WHEN trains.direction = 'west' THEN 1 ELSE 0 END)AS COUNT FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.wheels = 3 AND cars.roof = 'jagged'
Database: trains
Note: 2 or less cars refers to trailPosi <= 2;
Question: Provide the directions for all the trains that have 2 or less cars.
SQL: SELECT trains.direction FROM trains INNER JOIN ( SELECT train_id, max(POSITION) AS trailposi FROM cars GROUP BY train_id ) AS t2 ON trains.id = t2.train_id WHERE t2.trailposi <= 2
Database: trains
Note: at least 4 cars refers to trailPosi >= 4; calculation = MULTIPLY(DIVidE(count(trailPosi >= 4 then id), count(id)), 100);
Question: What is the percentage of all the trains with at least 4 cars? List the directions of the said trains.
SQL: SELECT cast(count(CASE WHEN t2.trailposi >= 4 THEN trains.id ELSE NULL END) AS REAL) * 100 / count(trains.id) FROM trains INNER JOIN ( SELECT train_id, max(POSITION) AS trailposi FROM cars GROUP BY train_id ) AS t2 ON trains.id = t2.train_id UNION ALL SELECT trains.direction FROM trains INNER JOIN ( SELECT train_id, max(POSITION) AS trailposi FROM cars t GROUP BY train_id ) AS t2 ON trains.id = t2.train_id AND t2.trailposi >= 4
Database: trains
Note: 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);
Question: 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
SQL: 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 trains.direction = 'east' THEN trains.id ELSE NULL END) AS REAL) * 100 / count(DISTINCT trains.id)) FROM cars INNER JOIN trains ON cars.train_id = trains.id WHERE cars.position = 1 AND cars.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 )
Database: movie
Note: movie Look Who's Talking refers to title = 'Look Who's Talking';
Question: Please list the names of the characters in the movie Look Who's Talking.
SQL: SELECT characters.`character name` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE movie.title = 'Look Who''s Talking'
Database: movie
Note: longest screen time refers to max(screentime); movie Batman refers to title = 'Batman';
Question: Which character has the longest screen time in the movie Batman?
SQL: SELECT characters.`character name` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE movie.title = 'Batman' ORDER BY characters.screentime DESC LIMIT 1
Database: movie
Note: role of Joker refers to character_name = 'Joker'; movie Batman refers to title = 'Batman';
Question: Which actor played the role of Joker in the movie Batman?
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Batman' AND characters.`character name` = 'Joker'
Database: movie
Note: movie Batman refers to title = 'Batman';
Question: Please list the names of the actors who played a role in the movie Batman.
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Batman'
Database: movie
Note: movie name refers to title; character Dr. Archibald 'Moonlight' Graham refers to character_name = 'Dr. Archibald 'Moonlight' Graham';
Question: Which movie is the character Dr. Archibald 'Moonlight' Graham from?
SQL: SELECT movie.title FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE characters.`character name` = 'Dr. Archibald ''Moonlight'' Graham'
Database: movie
Note: movie name refers to title; starring Tom Cruise refers to name = 'Tom Cruise';
Question: Please list the names of the movies starring Tom Cruise.
SQL: SELECT movie.title FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Tom Cruise'
Database: movie
Note: 'suggested by parental guidance' refers to mpaa_rating = 'PG';
Question: How many movies starring Morgan Freeman are suggested by parental guidance?
SQL: SELECT count(*) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Morgan Freeman' AND movie.`mpaa rating` = 'PG'
Database: movie
Note: starring Tom Cruise refers to name = 'Tom Cruise'; best quality refers to max(rating);
Question: Among the movies starring Tom Cruise, which one of them has the best quality?
SQL: SELECT movie.title FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Tom Cruise' ORDER BY movie.rating DESC LIMIT 1
Database: movie
Note: 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';
Question: What is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?
SQL: SELECT characters.`character name` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Tom Cruise' AND movie.title = 'Born on the Fourth of July'
Database: movie
Note: played by Tom Cruise refers to name = 'Tom Cruise';
Question: Please list the names of all the characters played by Tom Cruise.
SQL: SELECT characters.`character name` FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE actor.name = 'Tom Cruise'
Database: movie
Note: movie Batman refers to title = 'Batman'; tallest refers to max(height_inches);
Question: Among the actors who starred in the movie Batman, which one of them is the tallest?
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Batman' ORDER BY actor.`height (inches)` DESC LIMIT 1
Database: movie
Note: male refers to gender = 'Male'; African American refers to ethnicity = 'African American';
Question: How many movies star a male African American actor?
SQL: SELECT count(*) FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE actor.gender = 'Male' AND actor.ethnicity = 'African American'
Database: movie
Note: starring Tom Cruise refers to name = 'Tom Cruise'; average rating = divide(sum(rating where name = 'Tom Cruise'), count(movieid where name = 'Tom Cruise'));
Question: What is the average rating of all the movies starring Tom Cruise?
SQL: SELECT avg(movie.rating) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE actor.name = 'Tom Cruise'
Database: movie
Note: 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%;
Question: How much longer in percentage is the screen time of the most important character in Batman than the least important one?
SQL: SELECT (max(cast(substr(characters.screentime, 3, 2) AS REAL)) - min(cast(substr(characters.screentime, 3, 2) AS REAL))) * 100 / min(cast(substr(characters.screentime, 3, 2) AS REAL)) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE movie.title = 'Batman'
Database: movie
Note: biggest budget refers to max(budget); name of the movie refers to title;
Question: Which movie had the biggest budget? Give the name of the movie.
SQL: SELECT title FROM movie ORDER BY budget DESC LIMIT 1
Database: movie
Note: 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;
Question: What is the MPAA rating for the movie with the character named "Peter Quill" in it?
SQL: SELECT movie.`mpaa rating` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE characters.`character name` = 'Peter Quill'
Database: movie
Note: No.1 character in the credit list refers to creditorder = '1'; highest rating refers to max(rating); thriller movie refers to genre = 'Thriller';
Question: Give the name of the No.1 character in the credit list from the highest rating thriller movie.
SQL: SELECT characters.`character name` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE characters.creditorder = '1' AND movie.genre = 'Thriller' ORDER BY movie.rating DESC LIMIT 1
Database: movie
Note: movie "Batman" refers to title = 'Batman'; longest screentime refers to max(screentime);
Question: Who was the actor that played in the movie "Batman" with the longest screentime?
SQL: SELECT actor.name FROM characters INNER JOIN actor ON characters.actorid = actor.actorid INNER JOIN movie ON movie.movieid = characters.movieid WHERE movie.title = 'Batman' ORDER BY characters.screentime DESC LIMIT 1
Database: movie
Note: highest networth refers to max(networth);
Question: How many movies has the highest networth actor acted in?
SQL: SELECT count(*) FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE cast(replace(replace(actor.networth, ',', ''), '$', '') AS REAL) = ( SELECT max(cast(replace(replace(networth, ',', ''), '$', '') AS REAL)) FROM actor)
Database: movie
Question: Who played the character named "Chanice Kobolowski"?
SQL: SELECT actor.name FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE characters.`character name` = 'Chanice Kobolowski'
Database: movie
Note: birthday refers to date of birth; "Sully" refers to character name = 'Sully';
Question: When is the birthday of the actor who played "Sully"?
SQL: SELECT actor.`date of birth` FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE characters.`character name` = 'Sully'
Database: movie
Note: "Gabriel Martin" refers to character name = 'Gabriel Martin';
Question: Show the birth city of the actor who played "Gabriel Martin".
SQL: SELECT actor.`birth city` FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE characters.`character name` = 'Gabriel Martin'
Database: movie
Note: "Michael Moscovitz" refers to character name = 'Michael Moscovitz';
Question: Give the biography of the actor who played "Michael Moscovitz".
SQL: SELECT actor.biography FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE characters.`character name` = 'Michael Moscovitz'
Database: movie
Note: tall refers to height (inches); "Lurch" refers to character name = 'Lurch';
Question: How tall is the actor who played "Lurch"?
SQL: SELECT actor.`height (inches)` FROM characters INNER JOIN actor ON characters.actorid = actor.actorid WHERE characters.`character name` = 'Lurch'
Database: movie
Note: 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';
Question: Show the No.3 character name in the credit list of the movie "G.I. Joe: The Rise of Cobra".
SQL: SELECT characters.`character name` FROM movie INNER JOIN characters ON movie.movieid = characters.movieid WHERE movie.title = 'G.I. Joe: The Rise of Cobra' AND characters.creditorder = '3'
Database: movie
Note: No.2 character refers to creditorder = '2'; movie "American Hustle" refers to title = 'American Hustle';
Question: Who played the No.2 character in the credit list of the movie "American Hustle"?
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'American Hustle' AND characters.creditorder = '2'
Database: movie
Note: No.1 character refers to creditorder = '1'; released on "2015/10/26" refers to release date = '2015-10-26';
Question: Who played the No.1 character in the credit list of the movie which was released on "2015/10/26"?
SQL: SELECT actor.name FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.`release date` = '2015-10-26' AND characters.creditorder = '1'
Database: movie
Note: 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%;
Question: What is the percentage of the USA actors that showed up in the credit list of movie "Mrs. Doubtfire"?
SQL: SELECT cast(sum(CASE WHEN actor.`birth country` = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / count(actor.`birth country`) FROM movie INNER JOIN characters ON movie.movieid = characters.movieid INNER JOIN actor ON actor.actorid = characters.actorid WHERE movie.title = 'Mrs. Doubtfire'