id int64 0 9.43k | db_id stringclasses 69
values | schema stringclasses 69
values | question stringlengths 24 325 | output stringlengths 23 804 | evidence stringlengths 0 673 | filtered_schema listlengths 0 16 |
|---|---|---|---|---|---|---|
1,200 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Among the users who use SUGAR, calculate the percentage of those who are above 20 years old. | SELECT SUM(IIF(T1.age > 20, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'SUGAR' | SUGAR refers to phone_brand = 'SUGAR'; percentage = MULTIPLY(DIVIDE(SUM(age > 20), COUNT(device_id)) 1.0); above 20 years old refers to age > 20; | [
"gender_age.age",
"gender_age.device_id",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.phone_brand"
] |
1,201 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Indicate the location of all the events that occurred on April 30, 2016. | SELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30' | location = longitude, latitude; on April 30, 2016 refers timestamp BETWEEN '2016-04-30 00:00:00' AND '2016-04-30 23:59:59'; | [
"events.latitude",
"events.longitude",
"events.timestamp"
] |
1,202 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many different models does the HTC brand have? | SELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC' | models refers to device_model; HTC brand refers to phone_brand = 'HTC'; | [
"phone_brand_device_model2.device_model",
"phone_brand_device_model2.phone_brand"
] |
1,203 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Identify all installed and activated apps by their id. | SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1 | installed refers to is_installed = 1; activated refers to is_active = 1; id refers to app_id; | [
"app_events.app_id",
"app_events.is_active",
"app_events.is_installed"
] |
1,204 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many apps are labeled 7? | SELECT COUNT(app_id) FROM app_labels WHERE label_id = 7 | labeled 7 refers to label_id = 7; | [
"app_labels.app_id",
"app_labels.label_id"
] |
1,205 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Identify by their id all the devices that are used by women who are in the age range of 29 to 31 years. | SELECT device_id FROM gender_age_train WHERE age BETWEEN 29 AND 31 AND gender = 'F' | id refers to device_id; women refers to gender = 'F'; age range of 29 to 31 years refers to age between 29 and 31; | [
"gender_age_train.age",
"gender_age_train.device_id",
"gender_age_train.gender"
] |
1,206 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Identify by their id all the apps that belong to the game-stress reliever category. | SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-stress reliever' | id refers to device_id; | [
"app_labels.app_id",
"app_labels.label_id",
"label_categories.category",
"label_categories.label_id"
] |
1,207 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | On what date were the most events logged on devices for 40-year-old male users? | SELECT T.timestamp FROM ( SELECT T2.timestamp, COUNT(T2.event_id) AS num FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'M' AND T1.age = 40 GROUP BY T2.timestamp ) AS T ORDER BY T.num DESC LIMIT 1 | date refers to timestamp; most events refers to MAX(COUNT(event_id)); 40-year-old refers to age = 40; male refers to gender = 'M'; | [
"T.num",
"T.timestamp",
"events_relevant.device_id",
"events_relevant.event_id",
"events_relevant.timestamp",
"gender_age.age",
"gender_age.device_id",
"gender_age.gender"
] |
1,208 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | On which brand of phone are the most applications installed? | SELECT T.phone_brand FROM ( SELECT T1.phone_brand, COUNT(T4.is_active) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id INNER JOIN events_relevant AS T3 ON T2.device_id = T3.device_id INNER JOIN app_events_relevant AS T4 ON T3.event_id = T4.event_id WHERE T4.is_acti... | brand of phone refers to phone_brand; most applications are installed refers to MAX(COUNT(is_installed = 1)); | [
"T.num",
"T.phone_brand",
"app_events_relevant.event_id",
"app_events_relevant.is_active",
"events_relevant.device_id",
"events_relevant.event_id",
"gender_age.device_id",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.phone_brand"
] |
1,209 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many men under the age of 23 have apps installed but are not active on their devices? | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.gender = 'M' AND T3.is_active = 0 AND T1.age < 23 | men refers to gender = 'M'; under the age of 23 refers to age < 23; installed refers to is_installed = 1; not active refers to is_active = 0; | [
"app_events_relevant.event_id",
"app_events_relevant.is_active",
"events_relevant.device_id",
"events_relevant.event_id",
"gender_age.age",
"gender_age.device_id",
"gender_age.gender"
] |
1,210 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many women have apps from the game-Finding fault category installed on their device? | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.age < 23 AND T1.gender = 'F' AND T3.is_active = 0 AND T3.is_installed = 1 | women refers to gender = 'F'; installed refers to is_installed = 1; | [
"app_events_relevant.event_id",
"app_events_relevant.is_active",
"app_events_relevant.is_installed",
"events_relevant.device_id",
"events_relevant.event_id",
"gender_age.age",
"gender_age.device_id",
"gender_age.gender"
] |
1,211 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Which gender logged in the most to an event in the first 10 days of May 2016? | SELECT T.gender FROM ( SELECT T1.gender, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE date(T2.timestamp) BETWEEN '2016-05-01' AND '2016-05-10' GROUP BY T1.gender ) AS T ORDER BY T.num DESC LIMIT 1 | gender that logged in the most refers to MAX(COUNT(gender)); first 10 days of May 2016 refers to timestamp BETWEEN '2016-05-01 00:00:00' AND '2016-05-10 23:59:59'; | [
"T.gender",
"T.num",
"events_relevant.device_id",
"events_relevant.timestamp",
"gender_age.device_id",
"gender_age.gender"
] |
1,212 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What age group is the most using SM-T2558 model phones? | SELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'SM-T2558' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1 | age group using SM-T2558 model phones the most refers to MAX(COUNT(group WHERE device_model = 'SM-T2558')); SM-T2558 model phones refers to device_model = 'SM-T2558'; | [
"T.group",
"T.num",
"gender_age.device_id",
"gender_age.group",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model"
] |
1,213 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many people over the age of 50 do not have HTC One M8 Eye phones? | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age > 50 AND T2.device_model != 'One M8 Eye' AND T2.phone_brand != 'HTC' | over the age of 50 refers to age > 50; do not have HTC One M8 Eye phones refers to phone_brand ! = 'HTC' AND device_model ! = 'One M8 Eye'; | [
"gender_age.age",
"gender_age.device_id",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model",
"phone_brand_device_model2.phone_brand"
] |
1,214 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Locate all events on devices of women under 30 years old. | SELECT T1.device_id FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T1.age < 30 | locate = longitude, latitude; women refers to gender = 'F'; under 30 years old refers to age < 30; | [
"events_relevant.device_id",
"gender_age.age",
"gender_age.device_id",
"gender_age.gender"
] |
1,215 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What percentage of women do not have applications installed on their mobile with respect to men? | SELECT SUM(IIF(T1.gender = 'F', 1, 0)) / SUM(IIF(T1.gender = 'M', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T3.is_installed = 0 | percentage = MULTIPLY(DIVIDE(SUM(gender = 'F'), SUM(gender = 'M')), 1.0); women refers to gender = 'F'; not installed refers to is_installed = 0; men refers to gender = 'M'; | [
"app_events_relevant.event_id",
"app_events_relevant.is_installed",
"events_relevant.device_id",
"events_relevant.event_id",
"gender_age.device_id",
"gender_age.gender"
] |
1,216 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Calculate the average age of people who have apps installed but are not active on their devices. | SELECT AVG(T1.age) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T3.is_installed = 1 AND T3.is_active = 0 | average age = AVG(age); installed refers to is_installed = 1; not active refers to is_active = 0; | [
"app_events_relevant.event_id",
"app_events_relevant.is_active",
"app_events_relevant.is_installed",
"events_relevant.device_id",
"events_relevant.event_id",
"gender_age.age",
"gender_age.device_id"
] |
1,217 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please list any three events that happened on the 1st of May 2016 that have the same latitude of 31. | SELECT event_id FROM events WHERE timestamp LIKE '2016-05-01%' AND latitude = 31 LIMIT 3 | on the 1st of May 2016 refers to timestamp like '2016-05-01%'; | [
"events.event_id",
"events.latitude",
"events.timestamp"
] |
1,218 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please list any three events that have the longitude and latitude of 0. | SELECT event_id FROM events WHERE longitude = 0 AND latitude = 0 LIMIT 3 | [
"events.event_id",
"events.latitude",
"events.longitude"
] | |
1,219 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What is the difference between the events of device number -9222956879900150000 that can be located and those that are unable to be located? | SELECT SUM(IIF(latitude != 0 AND longitude != 0, 1, 0)) - SUM(IIF(latitude = 0 AND longitude = 0, 1, 0)) AS diff FROM events WHERE device_id = '-922956879900150000' | difference = SUBTRACT(SUM(latitude! = 0 and longitude! = 0), SUM(latitude = 0 and longitude = 0)); device number refers to device_id; device_id = -922956879900150000; can be location refers to latitude ! = 0 and longitude ! = 0; unable to be location refers to latitude = 0 and longitude = 0; | [
"events.device_id",
"events.latitude",
"events.longitude"
] |
1,220 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please list any three devices that are owned by female users. | SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3 | female refers to gender = 'F'; | [
"gender_age.device_id",
"gender_age.gender"
] |
1,221 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please list any five app categories that are related to games, along with their label ID. | SELECT category, label_id FROM label_categories WHERE category LIKE '%game%' LIMIT 5 | app categories refers to category; related to games refers to category like '%game%'; | [
"label_categories.category",
"label_categories.label_id"
] |
1,222 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please list any three OPPO device models. | SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 3 | OPPO refers to phone_brand = 'OPPO'; | [
"phone_brand_device_model2.device_model",
"phone_brand_device_model2.phone_brand"
] |
1,223 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What is the percentage of users who experienced event number 6 who have the app installed but do not use the app? | SELECT SUM(IIF(is_installed = 1 AND is_active = 0, 1, 0)) / COUNT(app_id) AS perrcent FROM app_events WHERE event_id = 6 | percentage = MULTIPLY(DIVIDE(SUM(is_installed = 1 and is_active = 0), COUNT(app_id)), 1.0); event number refers to event_id = 6; installed refers to is_installed = 1; do not use refers to is_active = 0; | [
"app_events.app_id",
"app_events.event_id",
"app_events.is_active",
"app_events.is_installed"
] |
1,224 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Which gender owned more of the Galaxy Note 2 device model? | SELECT IIF(SUM(IIF(T1.gender = 'M', 1, 0)) - SUM(IIF(T1.gender = 'F', 1, 0)) > 0, 'M', 'F') AS gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2' | gender that owned more = SUBTRACT(IF(SUM(gender = 'M'), SUM(gender = 'F'),'M','F')); | [
"gender_age.device_id",
"gender_age.gender",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model"
] |
1,225 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | When did event number 2 happen and how many users were active? | SELECT COUNT(T1.app_id) AS num FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 2 AND T1.is_active = 1 GROUP BY T2.timestamp | event number refers to event_id; event_id = 2; active refers to is_active = 1; | [
"app_events.app_id",
"app_events.event_id",
"app_events.is_active",
"events.event_id",
"events.timestamp"
] |
1,226 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Which behavior category does user number 5902120154267990000 belong to? | SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = 5902120154267990000 | behavior category refers to category; number refers to app_id; app_id = 5902120154267990000; | [
"app_labels.app_id",
"app_labels.label_id",
"label_categories.category",
"label_categories.label_id"
] |
1,227 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many users belong to the same behavior category as comics? | SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'comics' | behavior category refers to category; category = 'comics'; | [
"app_labels.app_id",
"app_labels.label_id",
"label_categories.category",
"label_categories.label_id"
] |
1,228 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What is the age and gender of the person who uses the device number 29182687948017100 on event number 1? | SELECT T1.age, T1.gender FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id = 29182687948017100 AND T2.event_id = 1 | device number refers to device_id; device_id = 29182687948017100; event number refers to event_id; and event_id = 1; | [
"events_relevant.device_id",
"events_relevant.event_id",
"gender_age.age",
"gender_age.device_id",
"gender_age.gender"
] |
1,229 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many male users have the log of events at the same longitude of 114? | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.longitude = 114 AND T1.gender = 'M' | male refers to gender = 'M'; | [
"events_relevant.device_id",
"events_relevant.longitude",
"gender_age.device_id",
"gender_age.gender"
] |
1,230 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | When did event number 7 happen for user number -8022267440849930000? | SELECT T1.timestamp FROM events_relevant AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.app_id = -8022267440849930000 AND T1.event_id = 7 | event number refers to event_id; event_id = 7; user number refers to app_id; app_id = -8022267440849930000; | [
"app_events.app_id",
"app_events.event_id",
"events_relevant.event_id",
"events_relevant.timestamp"
] |
1,231 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What are the behavior categories that user number -9222198347540750000 belongs to? | SELECT T3.category FROM app_all AS T1 INNER JOIN app_labels AS T2 ON T1.app_id = T2.app_id INNER JOIN label_categories AS T3 ON T2.label_id = T3.label_id WHERE T1.app_id = -9222198347540750000 | behavior categories refers to category; user number refers to app_id; app_id = -9222198347540750000; | [
"app_all.app_id",
"app_labels.app_id",
"app_labels.label_id",
"label_categories.category",
"label_categories.label_id"
] |
1,232 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please provide the age group of any LG Nexus 4 device users. | SELECT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'LG' AND T2.device_model = 'Nexus 4' | age group refers to `group`; LG Nexus 4 refers to phone_brand = 'LG' AND device_model = 'Nexus 4'; | [
"gender_age.device_id",
"gender_age.group",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model",
"phone_brand_device_model2.phone_brand"
] |
1,233 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Please provide the gender of at least one user who owns an HTC Desire 826 device. | SELECT T1.gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Desire 826' AND T2.phone_brand = 'HTC' | HTC Desire 826 refers to phone_brand = 'HTC' AND device_model = 'Desire 826'; | [
"gender_age.device_id",
"gender_age.gender",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model",
"phone_brand_device_model2.phone_brand"
] |
1,234 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What is the percentage of users who are in the same behavior category as "Academic Information"? | SELECT SUM(IIF(T1.category = 'Academic Information', 1.0, 0)) / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id | percentage = MULTIPLY(DIVIDE(SUM(category = 'Academic Information'), COUNT(app_id)), 1.0); behavior category refers to category; category = 'Academic Information'; | [
"app_labels.app_id",
"app_labels.label_id",
"label_categories.category",
"label_categories.label_id"
] |
1,235 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What is the percentage of device users in the F27-28 age group who experienced an event on the 3rd of May 2016? | SELECT SUM(IIF(T1.`group` = 'F27-28', 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE SUBSTR(T2.timestamp, 1, 10) = '2016-05-03' | percentage = MULTIPLY(DIVIDE(SUM(`group` = 'F27-28'), COUNT(device_id)), 1.0); on the 3rd of May 2016 refers to timestamp = '2016-05-03%'; | [
"events_relevant.device_id",
"events_relevant.timestamp",
"gender_age.device_id",
"gender_age.group"
] |
1,236 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many OPPO devices are there? | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' | OPPO devices refers to phone_brand = 'OPPO'; | [
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.phone_brand"
] |
1,237 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What is the most common age group among all device users? | SELECT T.num FROM ( SELECT `group`, COUNT(`group`) AS num FROM gender_age GROUP BY `group` ) T | most common age group refers to MAX(COUNT(`group`)); | [
"T.num",
"gender_age.group"
] |
1,238 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many events does the device "4069764298338760000" have? | SELECT COUNT(event_id) FROM events WHERE device_id = 4069764298338760000 | [
"events.device_id",
"events.event_id"
] | |
1,239 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many of the apps belong in the "Equity Fund" category? | SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'Equity Fund' | [
"app_labels.app_id",
"app_labels.label_id",
"label_categories.category",
"label_categories.label_id"
] | |
1,240 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | List all females aged 24 to 26 devices' locations. | SELECT T2.longitude, T2.latitude FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'F24-26' AND T1.gender = 'F' | females refers to gender = 'F'; aged 24 to 26 refers to `group` = 'F24-26'; | [
"events_relevant.device_id",
"events_relevant.latitude",
"events_relevant.longitude",
"gender_age.device_id",
"gender_age.gender",
"gender_age.group"
] |
1,241 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | How many male users have a Galaxy Note 3? | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 3' AND T1.gender = 'M' | male refers to gender = 'M'; Galaxy Note 3 refers to device_model = 'Galaxy Note 3'; | [
"gender_age.device_id",
"gender_age.gender",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model"
] |
1,242 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM. | SELECT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-07 06:03:22' | devices' brands refers to phone_brand; models refers to device_model; on 5/7/2016 at 6:03:22 AM refers to timestamp = '2016-05-07 06:03:22'; | [
"events_relevant.device_id",
"events_relevant.timestamp",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.device_model",
"phone_brand_device_model2.phone_brand"
] |
1,243 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | Which brand is most common among people in their twenties? | SELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T2.phone_brand) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 30 GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1 | brand refers to phone_brand; brand that is most common refers to MAX(COUNT(phone_brand)); twenties refers to age BETWEEN 20 AND 30; | [
"T.num",
"T.phone_brand",
"gender_age.age",
"gender_age.device_id",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.phone_brand"
] |
1,244 | talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | What percentage of vivo devices belong to users with no information? | SELECT SUM(IIF(T1.gender IS NULL AND T1.age IS NULL AND T1.`group` IS NULL, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' | percentage = MULTIPLY(DIVIDE(SUM(gender = NULL and age = NULL and `group` = NULL), COUNT(device_id)), 1.0); vivo devices refers to phone_brand = 'vivo'; no information refers to gender = NULL AND age = NULL AND `group` = NULL; | [
"gender_age.age",
"gender_age.device_id",
"gender_age.gender",
"gender_age.group",
"phone_brand_device_model2.device_id",
"phone_brand_device_model2.phone_brand"
] |
1,245 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Please list all the keywords of the episode "Refuge: Part 1". | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Refuge: Part 1' | episode "Refuge: Part 1" refers to title = 'Refuge: Part 1' | [
"Episode.episode_id",
"Episode.title",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,246 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many keywords are there for season 9, episode 23 of law_and_order? | SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.season = 9 AND T1.episode = 23 | [
"Episode.episode",
"Episode.episode_id",
"Episode.season",
"Keyword.episode_id",
"Keyword.keyword"
] | |
1,247 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What is the title of the episode with the keyword "laundering money"? | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'laundering money' | keyword "laundering money" refers to keyword = 'laundering money' | [
"Episode.episode_id",
"Episode.title",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,248 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Please list all the keywords for the episodes with a rating of over 8. | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.rating > 8 | a rating of over 8 refers to rating > 8 | [
"Episode.episode_id",
"Episode.rating",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,249 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many 10-star votes were given to the episode titled "Cherished"? | SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.stars = 10 | 10-star vote refers to stars = 10; titled "Cherished" refers to title = 'Cherished' | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.stars",
"Vote.votes"
] |
1,250 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many votes did the episode titled "Cherished" get in total? | SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' | titled "Cherished" refers to title = 'Cherished' | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.votes"
] |
1,251 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What is the title of the episode that got the most 10-star votes? | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 ORDER BY T2.votes DESC LIMIT 1 | the most refers to max(votes); 10-star refers to stars = 10 | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.stars",
"Vote.votes"
] |
1,252 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Park Dietz was credited in which role in the episode titled "Cherished"? | SELECT T2.role FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T3.name = 'Park Dietz' AND T2.credited = 'true' | credited refers to credited = 'true'; titled "Cherished" refers to title = 'Cherished' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Credit.role",
"Episode.episode_id",
"Episode.title",
"Person.name",
"Person.person_id"
] |
1,253 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many people had filled a role in the episode titled "Cherished", but did not show up in the on-screen credits? | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.credited = 'false' | titled "Cherished" refers to title = 'Cherished'; did not show up in the on-screen credits refers to credited = '' | [
"Credit.credited",
"Credit.episode_id",
"Episode.episode_id",
"Episode.title"
] |
1,254 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who was credited as "technical advisor" in the episode titled "Cherished"? | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T2.credited = 'true' AND T2.role = 'technical advisor' | who refers to name; credited refers to credited = 'true'; as "technical advisor" refers to role = 'technical advisor'; titled "Cherished" refers to title = 'Cherished' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Credit.role",
"Episode.episode_id",
"Episode.title",
"Person.name",
"Person.person_id"
] |
1,255 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | For how many times was Park Dietz credited? | SELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz' | credited refers to credited = 'true' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Episode.episode_id",
"Person.name",
"Person.person_id"
] |
1,256 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Please list the titles of all the episodes in which Park Dietz was credited. | SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz' | credited refers to credited = 'true' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Episode.episode_id",
"Episode.title",
"Person.name",
"Person.person_id"
] |
1,257 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Was Anthony Azzara's role in episode tt0629204 displayed in the credits at the end of the episode? | SELECT T1.credited FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Anthony Azzara' AND T1.episode_id = 'tt0629204' | episode tt0629204 refers to episode_id = 'tt0629204'; credited refers to credited = 'true'; not credited refers to credited = '' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Person.name",
"Person.person_id"
] |
1,258 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many keywords are there in the episode Disciple? | SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple' | episode Disciple refers to title = 'Disciple' | [
"Episode.episode_id",
"Episode.title",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,259 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Which episode got the most 1 star votes? Give its title. | SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 1 ORDER BY T1.votes DESC LIMIT 1 | the most refers to max(votes); 1 star refers to stars = '1' | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.stars",
"Vote.votes"
] |
1,260 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many nominations did Law and Order season 9, episode 20 get? | SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 20 | Law and Order refers to series = 'Law and Order' | [
"Award.award_id",
"Award.episode_id",
"Award.series",
"Episode.episode",
"Episode.episode_id",
"Episode.season"
] |
1,261 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | For season 9, episode 17 of the show Law and Order, how many roles have been included in the credit? | SELECT COUNT(T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 17 AND T2.credited = 'true' | Law and Order refers to series = 'Law and Order'; included in the credit refers to credited = 'true' | [
"Credit.credited",
"Credit.episode_id",
"Credit.role",
"Episode.episode",
"Episode.episode_id",
"Episode.season",
"Episode.series"
] |
1,262 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Describe what happened in the episode of award no.296. | SELECT T1.summary FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.award_id = 296 | description of what happened refers to summary; award no.296 refers to award_id = '296' | [
"Award.award_id",
"Award.episode_id",
"Episode.episode_id",
"Episode.summary"
] |
1,263 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Which role did Joseph Blair play in the show? | SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair' | [
"Credit.person_id",
"Credit.role",
"Person.name",
"Person.person_id"
] | |
1,264 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many awards has Rene Balcer been nominated for? | SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer' | [
"Award.award_id",
"Award.person_id",
"Person.name",
"Person.person_id"
] | |
1,265 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | For the episode with the most votes, give its air date. | SELECT T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id GROUP BY T2.episode_id ORDER BY SUM(T1.votes) DESC LIMIT 1 | the most votes refers to max(votes) | [
"Episode.air_date",
"Episode.episode_id",
"Vote.episode_id",
"Vote.votes"
] |
1,266 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who was nominated for award no.313? Give the full name. | SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award_id = 313 | award no.313 refers to award_id = '313'; full name refers to name | [
"Award.award_id",
"Award.person_id",
"Person.name",
"Person.person_id"
] |
1,267 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many episodes did J.K. Simmons' role appear on the show? | SELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'J.K. Simmons' | [
"Credit.person_id",
"Credit.role",
"Person.name",
"Person.person_id"
] | |
1,268 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Display the number of 9-star votes the episode Sideshow received. | SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 9 AND T1.title = 'Sideshow' | 9-star vote refers to stars = '9'; episode Sideshow refers to title = 'Sideshow' | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.stars",
"Vote.votes"
] |
1,269 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many times is the number of keywords in "Refuge: Part 1" episode than "Shield" episode? | SELECT CAST(SUM(CASE WHEN T1.title = 'Refuge: Part 1' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Shield' THEN 1 ELSE 0 END) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id | "Refuge: Part 1" episode refers to title = 'Refuge: Part 1'; "Shield" episode refers to title = 'Shield'; times = divide(count(keyword where title = 'Refuge: Part 1'), count(keyword where title = 'Shield')) | [
"Episode.episode_id",
"Episode.title",
"Keyword.episode_id"
] |
1,270 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Calculate the average number of cast members that appeared in the credit from the 185th to the 193rd episode. | SELECT CAST(COUNT(T1.episode_id) AS REAL) / (193 - 185 + 1) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T1.credited = 'true' AND T2.number_in_series BETWEEN 185 AND 193 | appeared in the credit refers to credited = 'TRUE'; from the 185th to the 193rd episode refers to number_in_series between 185 and 193; cast refers to category = 'Cast'; average number = divide(count(episode_id), 9) | [
"Credit.category",
"Credit.credited",
"Credit.episode_id",
"Episode.episode_id",
"Episode.number_in_series"
] |
1,271 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What are the names of the person that were not credited at the end of episode tt0629391? | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.credited = 'false' AND T1.episode_id = 'tt0629391' | not credited refers to credited = ''; episode tt0629391 refers to episode_id = 'tt0629391' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Person.name",
"Person.person_id"
] |
1,272 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many people have won at least 3 awards? | SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.result = 'Winner' GROUP BY T1.person_id HAVING COUNT(T2.award_id) >= 3 | won refers to result = 'Winner'; at least 3 awards refers to count(result) > 3 | [
"Award.award_id",
"Award.person_id",
"Award.result",
"Person.person_id"
] |
1,273 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who is the script supervisor of the series in episode tt0629204? | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629204' AND T1.role = 'script supervisor' | who refers to name; script supervisor refers to role = 'script supervisor'; episode tt0629204 refers to episode_id = 'tt0629204' | [
"Credit.episode_id",
"Credit.person_id",
"Credit.role",
"Person.name",
"Person.person_id"
] |
1,274 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many awards has Julia Roberts been nominated for? | SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Julia Roberts' AND T2.result = 'Nominee' | been nominated refers to result = 'Nominee' | [
"Award.award_id",
"Award.person_id",
"Award.result",
"Person.name",
"Person.person_id"
] |
1,275 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who is the tallest camera operator? | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'camera operator' ORDER BY T2.height_meters DESC LIMIT 1 | who refers to name; the tallest refers to max(height_meters); camera operator refers to role = 'camera operator' | [
"Credit.person_id",
"Credit.role",
"Person.height_meters",
"Person.name",
"Person.person_id"
] |
1,276 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many people, who were born in Canada, won an award in 1999? | SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 1999 AND T1.birth_country = 'Canada' | born in Canada refers to birth_country = 'Canada'; in 1999 refers to year = 1999 | [
"Award.person_id",
"Award.year",
"Person.birth_country",
"Person.person_id"
] |
1,277 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many people gave the most enjoyed episode a 10-star rating? | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 | the most enjoyed refers max(rating); 10-star refers to stars = 10 | [
"Episode.episode_id",
"Vote.episode_id",
"Vote.stars"
] |
1,278 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What are the keywords of the "Shield" episode? | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield' | "Shield" episode refers to title = 'Shield' | [
"Episode.episode_id",
"Episode.title",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,279 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What is the percentage of people who gave the "True North" episode a 1-star rating? | SELECT CAST(SUM(CASE WHEN T2.stars = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' AND T1.episode_id = 'tt0629477' | the "True North" episode refers to title = 'True North'; 1-star refers to stars = 1; percentage = divide(count(episode_id where stars = 1), count(episode_id)) * 100% where title = 'True North' | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.stars"
] |
1,280 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What is the title of the episode with the highest number of keywords? | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(T2.keyword) DESC LIMIT 1 | the highest number of keywords refers to max(count(keyword)) | [
"Episode.episode_id",
"Episode.title",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,281 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Among the episodes that were aired in 1998, how many won an International Monitor Awards? | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE strftime('%Y', T1.air_date) = '1998' AND T2.organization = 'International Monitor Awards' AND T2.result = 'Winner' | aired in 1998 refers to air_date like '1998%'; won refers to result = 'Winner'; International Monitor Awards refers to organization = 'International Monitor Awards' | [
"Award.episode_id",
"Award.organization",
"Award.result",
"Episode.air_date",
"Episode.episode_id"
] |
1,282 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many times did the episode titled "Agony" win an award? | SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner' | titled "Agony" refers to title = 'Agony'; win an award refers to result = 'Winner' | [
"Award.award_id",
"Award.episode_id",
"Award.result",
"Episode.episode_id",
"Episode.title"
] |
1,283 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many episodes are there in the 9th season of Law and Order? Calculate the average number of casts per season of the said series. | SELECT SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.episode_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T2.series = 'Law and Order' | the 9th season refers to season = 9; Law and Order refers to series = 'Law and Order'; cast refers to category = 'Cast'; average number of casts per season = divide(count(person_id), count(episode_id)) | [
"Credit.category",
"Credit.episode_id",
"Episode.episode_id",
"Episode.season",
"Episode.series"
] |
1,284 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What are the keywords of the episode which received the 2nd-highest number of votes? | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.votes NOT IN ( SELECT MAX(T1.votes) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id ) ORDER BY T1.votes DESC LIMIT 1 | the 2nd-highest number of votes refers to second max(votes) | [
"Episode.episode_id",
"Episode.votes",
"Keyword.episode_id",
"Keyword.keyword"
] |
1,285 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many awards did the "Agony" win? | SELECT COUNT(T2.award) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner' | the "Agony" refers to title = 'Agony'; win refers to result = 'Winner' | [
"Award.award",
"Award.episode_id",
"Award.result",
"Episode.episode_id",
"Episode.title"
] |
1,286 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who is the narrator of the "Flight" episode? | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Flight' AND T2.role = 'Narrator' | who refers to name; narrator refers to role = 'Narrator'; the "Flight" episode refers to title = 'Flight' | [
"Credit.episode_id",
"Credit.person_id",
"Credit.role",
"Episode.episode_id",
"Episode.title",
"Person.name",
"Person.person_id"
] |
1,287 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | In which organization did Constantine Makris win the most awards? | SELECT T2.organization FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Constantine Makris' AND T2.result = 'Winner' GROUP BY T2.organization ORDER BY COUNT(T2.award_id) DESC LIMIT 1 | win refers to result = 'Winner'; the most awards refers to max(count(award_id)) | [
"Award.award_id",
"Award.organization",
"Award.person_id",
"Award.result",
"Person.name",
"Person.person_id"
] |
1,288 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who is the stunt coordinator in episode 3? | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 3 AND T2.role = 'stunt coordinator' | who refers to name; stunt coordinator refers to role = 'stunt coordinator' | [
"Credit.episode_id",
"Credit.person_id",
"Credit.role",
"Episode.episode",
"Episode.episode_id",
"Person.name",
"Person.person_id"
] |
1,289 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many people were not credited at the end of the "Admissions" episode? | SELECT COUNT(T2.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Admissions' AND T2.credited = 'false' | not credited refers to credited = ''; the "Admissions" episode refers to title = 'Admissions' | [
"Credit.credited",
"Credit.episode_id",
"Credit.person_id",
"Episode.episode_id",
"Episode.title"
] |
1,290 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What is the title of the episode that has the highest number of crews in the Art Department? | SELECT T2.title FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Art Department' GROUP BY T2.episode_id ORDER BY COUNT(T1.category) DESC LIMIT 1 | the highest number of crews refers to max(count(person_id)); in the Art Department refers to category = 'Art Department' | [
"Credit.category",
"Credit.episode_id",
"Episode.episode_id",
"Episode.title"
] |
1,291 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many roles did Julia Roberts play in the series? | SELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Julia Roberts' | [
"Credit.person_id",
"Credit.role",
"Person.name",
"Person.person_id"
] | |
1,292 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What are the titles of the top 3 episodes that received no less than 30 votes in its 10-star rating? | SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.votes >= 30 AND T1.stars = 10 ORDER BY T1.votes DESC LIMIT 3 | no less than 30 votes refers to votes > = 30; 10-star rating refers to stars = 10 | [
"Episode.episode_id",
"Episode.title",
"Vote.episode_id",
"Vote.stars",
"Vote.votes"
] |
1,293 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who is the youngest person to ever play a "clerk" role in the series? | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'Clerk' AND T2.birthdate IS NOT NULL ORDER BY T2.birthdate LIMIT 1 | who refers to name; the youngest person refers to max(birthdate); a "clerk" role refers to role = 'Clerk' | [
"Credit.person_id",
"Credit.role",
"Person.birthdate",
"Person.name",
"Person.person_id"
] |
1,294 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many people did not enjoy the finale episode? | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 24 AND T2.stars = 1 | did not enjoy refers to stars = 1; the finale episode refers to episode = 24 | [
"Episode.episode",
"Episode.episode_id",
"Vote.episode_id",
"Vote.stars"
] |
1,295 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | List the names of all the cast members in the series. | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.category = 'Cast' | cast member refers to category = 'Cast' | [
"Credit.category",
"Credit.person_id",
"Person.name",
"Person.person_id"
] |
1,296 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Who is the person who appeared the most in the series? Calculate in percentage how many times he or she appeared. | SELECT T2.person_id, CAST(COUNT(T2.person_id) AS REAL) * 100 / ( SELECT COUNT(T2.person_id) AS num FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id ) AS per FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id GROUP BY T2.person_id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 | who refers to name; appear the most refers to max(count(person_id)); percentage = divide(count(person_id where max(count(person_id))), count(person_id)) * 100% | [
"Credit.person_id",
"Person.person_id"
] |
1,297 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | Which episodes of the Law & Order have been nominated for the Primetime Emmy Awards? | SELECT DISTINCT episode_id FROM Award WHERE award_category = 'Primetime Emmy' | episode refers to award; the Primetime Emmy Awards refers to award_category like 'Primetime Emmy' | [
"Award.award_category",
"Award.episode_id"
] |
1,298 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | How many episodes have not won any Law & Order series awards? | SELECT COUNT(award_id) FROM Award WHERE Result = 'Nominee' | have not won any award refers to Result = 'Nominee' | [
"Award.Result",
"Award.award_id"
] |
1,299 | law_episode | CREATE TABLE Episode
(
episode_id TEXT
primary key,
series TEXT,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date DATE,
episode_image TEXT,
rating ... | What roles have not been credited at the end of the episodes? | SELECT DISTINCT role FROM Credit WHERE credited = 'false' | have not been credited refers to credited = '' | [
"Credit.credited",
"Credit.role"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.