db_id stringclasses 69
values | schema stringclasses 69
values | m_schema stringclasses 69
values | question stringlengths 24 325 | sql stringlengths 23 804 | evidence stringlengths 0 673 |
|---|---|---|---|---|---|
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | at least one empty-loaded car run refers to load_num = 0 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | shape = 'ellipse' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | short cars refers to len = 'short' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | head cars refers to position = 1; |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | flat roof refers to roof = 'flat' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | flat roof refers to roof = 'flat'; load_shape = 'circle' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | more rectangle-shaped cars refers to MAX(rectCarsNum) |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | short refers to len = 'short'; 4 cars run refers to position = 4 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | calculation = DIVIDE(count(id), count(train_id)) |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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') | non-regular shaped car refers to shape in ('bucket', 'ellipse'); calculation = MULTIPLY(DIVIDE(count(direction = 'east' then train_id)), count(train_id), 100) |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | How many short cars are in the shape of hexagon? | SELECT COUNT(id) FROM cars WHERE shape = 'hexagon' AND len = 'short' | short cars refers to len = 'short'; in the shape of hexagon refers to shape = 'hexagon' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | How many trains are running west? | SELECT COUNT(id) FROM trains WHERE direction = 'west' | west is a direction |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | What are the load shapes of all the short ellipse cars? | SELECT load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short' | short refers to len = 'short'; ellipse cars refers to shape = 'ellipse' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | What are the ids of the train running east? | SELECT id FROM trains WHERE direction = 'east' | east is a direction |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | How many wheels do the long cars have? | SELECT SUM(wheels) FROM cars WHERE len = 'long' | long cars refers to len = 'long' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | Which direction do the majority of the trains are running? | SELECT direction FROM trains GROUP BY direction ORDER BY COUNT(id) DESC | majority of train refers to MAX(count(id)) |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | east is a direction; at least 4 cars refers to carsNum > = 4 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | most of the trains refers to MAX(count(id)); second cars refers to position = 2 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | west is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | eastbound refers to direction = 'east'; head cars refers to position = 1 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | running west refers to direction = 'west'; open roof refers to roof = 'none' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | 3 cars refers to carsNum = 3 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | fully loaded refers to load_num = 3; head cars refers to position = 1 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | east is an direction; double-sided refers to sides = 'double'; tail refers to carsposition = trailPosi |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | empty cars refers to load_num = 0 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | 2nd car refers to position = 2 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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' | west is an direction; three-wheeled refers to wheels = 3; jagged roof refers to roof = 'jagged' |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 | 2 or less cars refers to trailPosi < = 2 |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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(po... | at least 4 cars refers to trailPosi > = 4; calculation = MULTIPLY(DIVIDE(count(trailPosi > = 4 then id), count(id)), 100) |
trains | CREATE TABLE `cars` (
`id` INTEGER NOT NULL,
`train_id` INTEGER DEFAULT NULL,
`position` INTEGER DEFAULT NULL,
`shape` TEXT DEFAULT NULL,
`len`TEXT DEFAULT NULL,
`sides` TEXT DEFAULT NULL,
`roof` TEXT DEFAULT NULL,
`wheels` INTEGER DEFAULT NULL,
`load_shape` TEXT DEFAULT NULL,
`load_num` INTEGER DEF... | 【DB_ID】 trains
【Schema】
# Table: main.cars
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(train_id:INTEGER, Examples: [1, 2, 3]),
(position:INTEGER, Examples: [1, 2, 3]),
(shape:TEXT, Examples: [rectangle, bucket, u_shaped]),
(len:TEXT, Examples: [short, long]),
(sides:TEXT, Examples: [not_double, double]),
(roof:T... | 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 ... | 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) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 Look Who's Talking refers to title = 'Look Who's Talking' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | longest screen time refers to max(screentime); movie Batman refers to title = 'Batman' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | role of Joker refers to character_name = 'Joker'; movie Batman refers to title = 'Batman' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 Batman refers to title = 'Batman' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 name refers to title; character Dr. Archibald 'Moonlight' Graham refers to character_name = 'Dr. Archibald 'Moonlight' Graham' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 name refers to title; starring Tom Cruise refers to name = 'Tom Cruise' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 'suggested by parental guidance' refers to mpaa_rating = 'PG' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | starring Tom Cruise refers to name = 'Tom Cruise'; best quality refers to max(rating) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 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' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | played by Tom Cruise refers to name = 'Tom Cruise' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 Batman refers to title = 'Batman'; tallest refers to max(height_inches) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | male refers to gender = 'Male'; African American refers to ethnicity = 'African American' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | starring Tom Cruise refers to name = 'Tom Cruise'; average rating = divide(sum(rating where name = 'Tom Cruise'), count(movieid where name = 'Tom Cruise')) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 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% |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | Which movie had the biggest budget? Give the name of the movie. | SELECT Title FROM movie ORDER BY Budget DESC LIMIT 1 | biggest budget refers to max(Budget); name of the movie refers to Title |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 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 |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | No.1 character in the credit list refers to creditOrder = '1'; highest rating refers to max(rating); thriller movie refers to Genre = 'Thriller' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 "Batman" refers to Title = 'Batman'; longest screentime refers to max(screentime) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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) | highest networth refers to max(networth) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | birthday refers to Date of Birth; "Sully" refers to Character Name = 'Sully' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | "Gabriel Martin" refers to Character Name = 'Gabriel Martin' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | "Michael Moscovitz" refers to Character Name = 'Michael Moscovitz' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | tall refers to Height (Inches); "Lurch" refers to Character Name = 'Lurch' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 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' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | No.2 character refers to creditOrder = '2'; movie "American Hustle" refers to Title = 'American Hustle' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | No.1 character refers to creditOrder = '1'; released on "2015/10/26" refers to Release Date = '2015-10-26' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 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% |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 "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% |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | a budget of 15000000 refers to Budget = 15000000; rating between 7 to 8 refers to Rating BETWEEN 7 and 8 |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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%' | rated PG refers to MPAA Rating = 'PG'; released in June 1990 refers to Release Date BETWEEN '1990-06-01' and '1990-06-30' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | male refers to Gender = 'Male'; white refers to Ethnicity = 'White' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | born in New York City refers to Birth City = 'New York City'; rating greater than 5 refers to Rating > 5 |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | romantic movies refers to Genre = 'Romance'; starred by John Travolta refers to Name = 'John Travolta' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | Three Men and a Little Lady refers to Title = 'Three Men and a Little Lady' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | PG rated refers to MPAA Rating = 'PG'; highest net worth refers to max(NetWorth) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | Misery refers to Title = 'Misery'; height ranging from 60 to 70 inches refers to Height (Inches) BETWEEN 60 and 70 |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | male refers to Gender = 'Male'; born in USA refers to Birth Country = 'USA'; Ghost refers to Title = 'Ghost' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | starred by Leonardo DiCaprio refers to Name = 'Leonardo Dicaprio'; highest budget refers to max(Budget) |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | Die Hard 2 refers to Title = 'Die Hard 2'; height between 60 to 65 refers to Height (Inches) BETWEEN 60 AND 65 |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | African-American refers to Ethnicity = 'African American'; born on December 28 1954 refers to Date of Birth = '1954-12-28' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | actor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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' | 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' |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | starred by Jackie Chan refers to Name = 'Jackie Chan'; rating greater than 7 refers to Rating > 7 |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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... | 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% |
movie | CREATE TABLE actor
(
ActorID INTEGER
constraint actor_pk
primary key,
Name TEXT,
"Date of Birth" DATE,
"Birth City" TEXT,
"Birth Country" TEXT,
"Height (Inches)" INTEGER,
Biography TEXT,
Gender TEXT,
Ethnicity ... | 【DB_ID】 movie
【Schema】
# Table: main.actor
[
(ActorID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Name:TEXT, Examples: [John Travolta, Kirstie Alley, Olympia Dukakis]),
(Date of Birth:DATE, Examples: [1954-02-18]),
(Birth City:TEXT, Examples: [Englewood, Wichita, Lowell]),
(Birth Country:TEXT, Examples: [USA, West Ger... | 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 | 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) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | How many tweets are in English? | SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en' | english is the language and refers to Lang = 'en' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | Please list the texts of all the tweets that are reshared. | SELECT text FROM twitter WHERE IsReshare = 'TRUE' | reshared refers to Isreshare = 'TRUE' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | How many tweets are seen by more than 1000 unique users? | SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000 | seen by more than 1000 unique users refers to Reach > 1000 |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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' | positive sentiment refers to Sentiment > 0; posted on Thursday refers to Weekday = 'Thursday' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | What is the text of the tweet that got the most `likes`? | SELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter ) | got the most like refers to Max(Likes) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | Please list all the cities in Argentina. | SELECT City FROM location WHERE City IS NOT NULL AND Country = 'Argentina' | "Argentina" is the Country |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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 | "Argentina" is the Country |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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 | "Argentina" is the Country; post the most tweets refers to Max(Count(TweetID)) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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' | reshared refers to Isreshare = 'TRUE'; 'Buenos Aires' is the City |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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' | "Buenos Aires" is the City; positive sentiment refers to Sentiment > 0 |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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 | tweet with the most likes refers to Max(Likes) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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 | "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)) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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' | "Buenos Aires" is the City; posted on Thursday refers to Weekday = 'Thursday' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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' | over 1000 likes refers to Likes > 1000; 'Male' is the Gender of user |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | 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' | male users refers to Gender = 'Male'; total tweets refers to Count(TweetID) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | What is the gender of the user who has posted the tweet that is seen by the most number of unique users? | SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Reach DESC LIMIT 1 | seen by the most number of unique users refers to Max(Reach) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | How many tweets are posted by male users in Argentina? | 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' | "Argentina" is the Country; male user refers to Gender = 'Male' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | Please list the texts of all the tweets posted by male users from Buenos Aires. | 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' | "Buenos Aires" is the City; male user refers to Gender = 'Male' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | What is the average number of tweets posted by the users in a city in Argentina? | 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' | "Argentina" is the Country; average number of tweets in a city = Divide (Count(TweetID where Country = 'Argentina'), Count (City)) |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | Among all the tweets with a positive sentiment, what is the percentage of those posted by a male user? | 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 | positive sentiment refers to Sentiment > 0; male user refers to Gender = 'Male'; percentage = Divide (Count(TweetID where Gender = 'Male'), Count (TweetID)) * 100 |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | Give the number of users who do not show their genders. | SELECT COUNT(UserID) AS user_number FROM user WHERE Gender = 'Unknown' | do not show their gender refers to Gender = 'Unknown' |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | State the number of states in the United Kingdom. | SELECT COUNT(State) AS State_number FROM location WHERE Country = 'United Kingdom' | "United Kingdom" is the Country |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | What is the code of Gwynedd State? | SELECT DISTINCT StateCode FROM location WHERE State = 'Gwynedd' | code refers to StateCode |
social_media | CREATE TABLE location
(
LocationID INTEGER
constraint location_pk
primary key,
Country TEXT,
State TEXT,
StateCode TEXT,
City TEXT
);
CREATE TABLE user
(
UserID TEXT
constraint user_pk
primary key,
Gender TEXT
);
CREATE TABLE twitter
(... | 【DB_ID】 social_media
【Schema】
# Table: main.location
[
(LocationID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Country:TEXT, Examples: [Albania, Algeria, Andorra]),
(State:TEXT, Examples: [Elbasan, Tirane, Souk Ahras]),
(StateCode:TEXT, Examples: [AL, DZ, AD]),
(City:TEXT, Examples: [Elbasan, Tirana, Souk Ahras])
]
# ... | Give the location id of West Sussex State. | SELECT DISTINCT LocationID FROM location WHERE State = 'West Sussex' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.