input
stringlengths
358
16.1k
output
stringlengths
24
805
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT COUNT(app_id) FROM app_labels WHERE label_id = 7;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT device_id FROM gender_age_train WHERE age BETWEEN 29 AND 31 AND gender = 'F';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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...
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT event_id FROM events WHERE timestamp LIKE '2016-05-01%' AND latitude = 31 LIMIT 3;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT event_id FROM events WHERE longitude = 0 AND latitude = 0 LIMIT 3;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT category, label_id FROM label_categories WHERE category LIKE '%game%' LIMIT 5;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 3;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT SUM(IIF(is_installed = 1 AND is_active = 0, 1, 0)) / COUNT(app_id) AS perrcent FROM app_events WHERE event_id = 6;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT T.num FROM ( SELECT `group`, COUNT(`group`) AS num FROM gender_age GROUP BY `group` ) T;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
SELECT COUNT(event_id) FROM events WHERE device_id = 4069764298338760000;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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;
[INST] Here is a database schema: app_all : app_id [ INTEGER ] primary_key app_events : event_id [ INTEGER ] app_events.event_id = events.event_id app_id [ INTEGER ] is_installed [ bool ] is_active [ bool ] app_events_relevant : event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id app_id [ INT...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'laundering money';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.rating > 8;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T1.summary FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.award_id = 296;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award_id = 313;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.category = 'Cast';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
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;
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT DISTINCT episode_id FROM Award WHERE award_category = 'Primetime Emmy';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT COUNT(award_id) FROM Award WHERE Result = 'Nominee';
[INST] Here is a database schema: 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 [ REAL ] votes [ INTEGER ] Keyword : episode_id [ TEXT ] Keyword.episode_id = E...
SELECT DISTINCT role FROM Credit WHERE credited = 'false';