Chinastark/bird_dataset huggingface dataset:
Database: talkingdata
Note: male refers to gender = 'M';
Question: Among the male users, how many users use device model of Desire 820?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.device_model = 'Desire 820' AND gender_age.gender = 'M'
Database: talkingdata
Note: above 20 refers to age > 20;
Question: Among the users who are above 20, how many users use device model of ELIFE E7 Mini?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.device_model = 'ELIFE E7 Mini' AND gender_age.age > 20
Database: talkingdata
Note: under 50 and above 20 refers to age BTWEEEN 20 AND 50;
Question: State the number of users who are under 50 and above 20 use device model of Galaxy Premier.
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE gender_age.age BETWEEN 20 AND 50 AND phone_brand_device_model2.device_model = 'Galaxy Premier'
Database: talkingdata
Note: male refers to gender = 'M';
Question: Give the number of male users who use phone branded HTC.
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE gender_age.gender = 'M' AND phone_brand_device_model2.phone_brand = 'HTC'
Database: talkingdata
Question: How many users who are between 20 and 60 use phone brand of TCL?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE gender_age.age BETWEEN 20 AND 60 AND phone_brand_device_model2.phone_brand = 'TCL'
Database: talkingdata
Note: 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;
Question: Among the users who use SUGAR, calculate the percentage of those who are above 20 years old.
SQL: SELECT sum(iif(gender_age.age > 20, 1, 0)) / count(gender_age.device_id) AS per FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.phone_brand = 'SUGAR'
Database: talkingdata
Note: location = longitude, latitude; on April 30, 2016 refers timestamp BETWEEN '2016-04-30 00:00:00' AND '2016-04-30 23:59:59';
Question: Indicate the location of all the events that occurred on April 30, 2016.
SQL: SELECT longitude, latitude FROM EVENTS WHERE date(TIMESTAMP) = '2016-04-30'
Database: talkingdata
Note: models refers to device_model; HTC brand refers to phone_brand = 'HTC';
Question: How many different models does the HTC brand have?
SQL: SELECT count(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC'
Database: talkingdata
Note: installed refers to is_installed = 1; activated refers to is_active = 1; id refers to app_id;
Question: Identify all installed and activated apps by their id.
SQL: SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1
Database: talkingdata
Note: labeled 7 refers to label_id = 7;
Question: How many apps are labeled 7?
SQL: SELECT count(app_id) FROM app_labels WHERE label_id = 7
Database: talkingdata
Note: id refers to device_id; women refers to gender = 'F'; age range of 29 to 31 years refers to age between 29 and 31;
Question: Identify by their id all the devices that are used by women who are in the age range of 29 to 31 years.
SQL: SELECT device_id FROM gender_age_train WHERE age BETWEEN 29 AND 31 AND gender = 'F'
Database: talkingdata
Note: id refers to device_id;
Question: Identify by their id all the apps that belong to the game-stress reliever category.
SQL: SELECT app_labels.app_id FROM label_categories INNER JOIN app_labels ON label_categories.label_id = app_labels.label_id WHERE label_categories.category = 'game-stress reliever'
Database: talkingdata
Note: date refers to timestamp; most events refers to MAX(COUNT(event_id)); 40-year-old  refers to age = 40; male refers to gender = 'M';
Question: On what date were the most events logged on devices for 40-year-old male users?
SQL: SELECT t.timestamp FROM ( SELECT events_relevant.timestamp, count(events_relevant.event_id) AS num FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE gender_age.gender = 'M' AND gender_age.age = 40 GROUP BY events_relevant.timestamp ) AS t ORDER BY t.num DESC LIMIT 1
Database: talkingdata
Note: brand of phone refers to phone_brand; most applications are installed refers to MAX(COUNT(is_installed = 1));
Question: On which brand of phone are the most applications installed?
SQL: SELECT t.phone_brand FROM ( SELECT phone_brand_device_model2.phone_brand, count(app_events_relevant.is_active) AS num FROM phone_brand_device_model2 INNER JOIN gender_age ON phone_brand_device_model2.device_id = gender_age.device_id INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id INNER JOIN app_events_relevant ON events_relevant.event_id = app_events_relevant.event_id WHERE app_events_relevant.is_active = 1 GROUP BY phone_brand_device_model2.phone_brand ) AS t ORDER BY t.num DESC LIMIT 1
Database: talkingdata
Note: 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;
Question: How many men under the age of 23 have apps installed but are not active on their devices?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id INNER JOIN app_events_relevant ON events_relevant.event_id = app_events_relevant.event_id WHERE gender_age.gender = 'M' AND app_events_relevant.is_active = 0 AND gender_age.age < 23
Database: talkingdata
Note: women refers to gender = 'F'; installed refers to is_installed = 1;
Question: How many women have apps from the game-Finding fault category installed on their device?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id INNER JOIN app_events_relevant ON events_relevant.event_id = app_events_relevant.event_id WHERE gender_age.age < 23 AND gender_age.gender = 'F' AND app_events_relevant.is_active = 0 AND app_events_relevant.is_installed = 1
Database: talkingdata
Note: 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';
Question: Which gender logged in the most to an event in the first 10 days of May 2016?
SQL: SELECT t.gender FROM ( SELECT gender_age.gender, count(gender_age.device_id) AS num FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE date(events_relevant.timestamp) BETWEEN '2016-05-01' AND '2016-05-10' GROUP BY gender_age.gender ) AS t ORDER BY t.num DESC LIMIT 1
Database: talkingdata
Note: 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';
Question: What age group is the most using SM-T2558 model phones?
SQL: SELECT t.`group` FROM ( SELECT gender_age.`group`, count(gender_age.device_id) AS num FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.device_model = 'SM-T2558' GROUP BY gender_age.`group` ) AS t ORDER BY t.num DESC LIMIT 1
Database: talkingdata
Note: 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';
Question: How many people over the age of 50 do not have HTC One M8 Eye phones?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE gender_age.age > 50 AND phone_brand_device_model2.device_model != 'One M8 Eye' AND phone_brand_device_model2.phone_brand != 'HTC'
Database: talkingdata
Note: locate = longitude, latitude; women refers to gender = 'F'; under 30 years old refers to age < 30;
Question: Locate all events on devices of women under 30 years old.
SQL: SELECT gender_age.device_id FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE gender_age.gender = 'F' AND gender_age.age < 30
Database: talkingdata
Note: 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';
Question: What percentage of women do not have applications installed on their mobile with respect to men?
SQL: SELECT sum(iif(gender_age.gender = 'F', 1, 0)) / sum(iif(gender_age.gender = 'M', 1, 0)) AS per FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id INNER JOIN app_events_relevant ON events_relevant.event_id = app_events_relevant.event_id WHERE app_events_relevant.is_installed = 0
Database: talkingdata
Note: average age = AVG(age); installed refers to is_installed = 1; not active refers to is_active = 0;
Question: Calculate the average age of people who have apps installed but are not active on their devices.
SQL: SELECT avg(gender_age.age) FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id INNER JOIN app_events_relevant ON events_relevant.event_id = app_events_relevant.event_id WHERE app_events_relevant.is_installed = 1 AND app_events_relevant.is_active = 0
Database: talkingdata
Note: on the 1st of May 2016 refers to timestamp like '2016-05-01%';
Question: Please list any three events that happened on the 1st of May 2016 that have the same latitude of 31.
SQL: SELECT event_id FROM EVENTS WHERE TIMESTAMP LIKE '2016-05-01%' AND latitude = 31 LIMIT 3
Database: talkingdata
Question: Please list any three events that have the longitude and latitude of 0.
SQL: SELECT event_id FROM EVENTS WHERE longitude = 0 AND latitude = 0 LIMIT 3
Database: talkingdata
Note: 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;
Question: What is the difference between the events of device number -9222956879900150000 that can be located and those that are unable to be located?
SQL: 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'
Database: talkingdata
Note: female refers to gender = 'F';
Question: Please list any three devices that are owned by female users.
SQL: SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3
Database: talkingdata
Note: app categories refers to category; related to games refers to category like '%game%';
Question: Please list any five app categories that are related to games, along with their label ID.
SQL: SELECT category, label_id FROM label_categories WHERE category LIKE '%game%' LIMIT 5
Database: talkingdata
Note: OPPO refers to phone_brand = 'OPPO';
Question: Please list any three OPPO device models.
SQL: SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 3
Database: talkingdata
Note: 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;
Question: What is the percentage of users who experienced event number 6 who have the app installed but do not use the app?
SQL: SELECT sum(iif(is_installed = 1 AND is_active = 0, 1, 0)) / count(app_id) AS perrcent FROM app_events WHERE event_id = 6
Database: talkingdata
Note: gender that owned more = SUBTRACT(IF(SUM(gender = 'M'), SUM(gender = 'F'),'M','F'));
Question: Which gender owned more of the Galaxy Note 2 device model?
SQL: SELECT iif(sum(iif(gender_age.gender = 'M', 1, 0)) - sum(iif(gender_age.gender = 'F', 1, 0)) > 0, 'M', 'F') AS gender FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.device_model = 'Galaxy Note 2'
Database: talkingdata
Note: event number refers to event_id; event_id = 2; active refers to is_active = 1;
Question: When did event number 2 happen and how many users were active?
SQL: SELECT count(app_events.app_id) AS num FROM app_events INNER JOIN EVENTS ON app_events.event_id = EVENTS.event_id WHERE app_events.event_id = 2 AND app_events.is_active = 1 GROUP BY EVENTS.timestamp
Database: talkingdata
Note: behavior category refers to category; number refers to app_id; app_id = 5902120154267990000;
Question: Which behavior category does user number 5902120154267990000 belong to?
SQL: SELECT label_categories.category FROM label_categories INNER JOIN app_labels ON label_categories.label_id = app_labels.label_id WHERE app_labels.app_id = 5902120154267990000
Database: talkingdata
Note: behavior category refers to category; category = 'comics';
Question: How many users belong to the same behavior category as comics?
SQL: SELECT count(app_labels.app_id) FROM label_categories INNER JOIN app_labels ON label_categories.label_id = app_labels.label_id WHERE label_categories.category = 'comics'
Database: talkingdata
Note: device number refers to device_id; device_id = 29182687948017100; event number refers to event_id; and event_id = 1;
Question: What is the age and gender of the person who uses the device number 29182687948017100 on event number 1?
SQL: SELECT gender_age.age, gender_age.gender FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE gender_age.device_id = 29182687948017100 AND events_relevant.event_id = 1
Database: talkingdata
Note: male refers to gender = 'M';
Question: How many male users have the log of events at the same longitude of 114?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE events_relevant.longitude = 114 AND gender_age.gender = 'M'
Database: talkingdata
Note: event number refers to event_id; event_id = 7; user number refers to app_id; app_id = -8022267440849930000;
Question: When did event number 7 happen for user number -8022267440849930000?
SQL: SELECT events_relevant.timestamp FROM events_relevant INNER JOIN app_events ON events_relevant.event_id = app_events.event_id WHERE app_events.app_id = -8022267440849930000 AND events_relevant.event_id = 7
Database: talkingdata
Note: behavior categories refers to category; user number refers to app_id; app_id = -9222198347540750000;
Question: What are the behavior categories that user number -9222198347540750000 belongs to?
SQL: SELECT label_categories.category FROM app_all INNER JOIN app_labels ON app_all.app_id = app_labels.app_id INNER JOIN label_categories ON app_labels.label_id = label_categories.label_id WHERE app_all.app_id = -9222198347540750000
Database: talkingdata
Note: age group refers to `group`; LG Nexus 4 refers to phone_brand = 'LG' AND device_model = 'Nexus 4';
Question: Please provide the age group of any LG Nexus 4 device users.
SQL: SELECT gender_age.`group` FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.phone_brand = 'LG' AND phone_brand_device_model2.device_model = 'Nexus 4'
Database: talkingdata
Note: HTC Desire 826 refers to phone_brand = 'HTC' AND device_model = 'Desire 826';
Question: Please provide the gender of at least one user who owns an HTC Desire 826 device.
SQL: SELECT gender_age.gender FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.device_model = 'Desire 826' AND phone_brand_device_model2.phone_brand = 'HTC'
Database: talkingdata
Note: percentage = MULTIPLY(DIVIDE(SUM(category = 'Academic Information'), COUNT(app_id)), 1.0); behavior category refers to category; category = 'Academic Information';
Question: What is the percentage of users who are in the same behavior category as "Academic Information"?
SQL: SELECT sum(iif(label_categories.category = 'Academic Information', 1.0, 0)) / count(app_labels.app_id) AS per FROM label_categories INNER JOIN app_labels ON label_categories.label_id = app_labels.label_id
Database: talkingdata
Note: percentage = MULTIPLY(DIVIDE(SUM(`group` = 'f27-28'), COUNT(device_id)), 1.0); on the 3rd of May 2016 refers to timestamp = '2016-05-03%';
Question: What is the percentage of device users in the F27-28 age group who experienced an event on the 3rd of May 2016?
SQL: SELECT sum(iif(gender_age.`group` = 'F27-28', 1, 0)) / count(gender_age.device_id) AS per FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE substr(events_relevant.timestamp, 1, 10) = '2016-05-03'
Database: talkingdata
Note: OPPO devices refers to phone_brand = 'OPPO';
Question: How many OPPO devices are there?
SQL: SELECT count(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO'
Database: talkingdata
Note: most common age group refers to MAX(COUNT(`group`));
Question: What is the most common age group among all device users?
SQL: SELECT t.num FROM ( SELECT `group`, count(`group`) AS num FROM gender_age GROUP BY `group` ) t
Database: talkingdata
Question: How many events does the device "4069764298338760000" have?
SQL: SELECT count(event_id) FROM EVENTS WHERE device_id = 4069764298338760000
Database: talkingdata
Question: How many of the apps belong in the "Equity Fund" category?
SQL: SELECT count(app_labels.app_id) FROM app_labels INNER JOIN label_categories ON app_labels.label_id = label_categories.label_id WHERE label_categories.category = 'Equity Fund'
Database: talkingdata
Note: females refers to gender = 'F'; aged 24 to 26 refers to `group` = 'f24-26';
Question: List all females aged 24 to 26 devices' locations.
SQL: SELECT events_relevant.longitude, events_relevant.latitude FROM gender_age INNER JOIN events_relevant ON gender_age.device_id = events_relevant.device_id WHERE gender_age.`group` = 'F24-26' AND gender_age.gender = 'F'
Database: talkingdata
Note: male refers to gender = 'M'; Galaxy Note 3 refers to device_model = 'Galaxy Note 3';
Question: How many male users have a Galaxy Note 3?
SQL: SELECT count(gender_age.device_id) FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.device_model = 'Galaxy Note 3' AND gender_age.gender = 'M'
Database: talkingdata
Note: 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';
Question: List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM.
SQL: SELECT phone_brand_device_model2.phone_brand, phone_brand_device_model2.device_model FROM phone_brand_device_model2 INNER JOIN events_relevant ON phone_brand_device_model2.device_id = events_relevant.device_id WHERE events_relevant.timestamp = '2016-05-07 06:03:22'
Database: talkingdata
Note: brand refers to phone_brand; brand that is most common refers to MAX(COUNT(phone_brand)); twenties refers to age BETWEEN 20 AND 30;
Question: Which brand is most common among people in their twenties?
SQL: SELECT t.phone_brand FROM ( SELECT phone_brand_device_model2.phone_brand, count(phone_brand_device_model2.phone_brand) AS num FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE gender_age.age BETWEEN 20 AND 30 GROUP BY phone_brand_device_model2.phone_brand ) AS t ORDER BY t.num DESC LIMIT 1
Database: talkingdata
Note: 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;
Question: What percentage of vivo devices belong to users with no information?
SQL: SELECT sum(iif(gender_age.gender IS NULL AND gender_age.age IS NULL AND gender_age.`group` IS NULL, 1, 0)) / count(gender_age.device_id) AS per FROM gender_age INNER JOIN phone_brand_device_model2 ON gender_age.device_id = phone_brand_device_model2.device_id WHERE phone_brand_device_model2.phone_brand = 'vivo'
Database: law_episode
Note: episode "Refuge: Part 1" refers to title = 'Refuge: Part 1';
Question: Please list all the keywords of the episode "Refuge: Part 1".
SQL: SELECT keyword.keyword FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE episode.title = 'Refuge: Part 1'
Database: law_episode
Question: How many keywords are there for season 9, episode 23 of law_and_order?
SQL: SELECT count(keyword.keyword) FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE episode.season = 9 AND episode.episode = 23
Database: law_episode
Note: keyword "laundering money" refers to keyword = 'laundering money';
Question: What is the title of the episode with the keyword "laundering money"?
SQL: SELECT episode.title FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE keyword.keyword = 'laundering money'
Database: law_episode
Note: a rating of over 8 refers to rating > 8;
Question: Please list all the keywords for the episodes with a rating of over 8.
SQL: SELECT keyword.keyword FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE episode.rating > 8
Database: law_episode
Note: 10-star vote refers to stars = 10; titled "Cherished" refers to title = 'Cherished';
Question: How many 10-star votes were given to the episode titled "Cherished"?
SQL: SELECT vote.votes FROM episode INNER JOIN vote ON episode.episode_id = vote.episode_id WHERE episode.title = 'Cherished' AND vote.stars = 10
Database: law_episode
Note: titled "Cherished" refers to title = 'Cherished';
Question: How many votes did the episode titled "Cherished" get in total?
SQL: SELECT sum(vote.votes) FROM episode INNER JOIN vote ON episode.episode_id = vote.episode_id WHERE episode.title = 'Cherished'
Database: law_episode
Note: the most refers to max(votes); 10-star refers to stars = 10;
Question: What is the title of the episode that got the most 10-star votes?
SQL: SELECT episode.title FROM episode INNER JOIN vote ON episode.episode_id = vote.episode_id WHERE vote.stars = 10 ORDER BY vote.votes DESC LIMIT 1
Database: law_episode
Note: credited refers to credited = 'true'; titled "Cherished" refers to title = 'Cherished';
Question: Park Dietz was credited in which role in the episode titled "Cherished"?
SQL: SELECT credit.role FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id INNER JOIN person ON person.person_id = credit.person_id WHERE episode.title = 'Cherished' AND person.name = 'Park Dietz' AND credit.credited = 'true'
Database: law_episode
Note: titled "Cherished" refers to title = 'Cherished'; did not show up in the on-screen credits refers to credited = '';
Question: How many people had filled a role in the episode titled "Cherished", but did not show up in the on-screen credits?
SQL: SELECT count(episode.episode_id) FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE episode.title = 'Cherished' AND credit.credited = 'false'
Database: law_episode
Note: who refers to name; credited refers to credited = 'true'; as "technical advisor" refers to role = 'technical advisor'; titled "Cherished" refers to title = 'Cherished';
Question: Who was credited as "technical advisor" in the episode titled "Cherished"?
SQL: SELECT person.name FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id INNER JOIN person ON person.person_id = credit.person_id WHERE episode.title = 'Cherished' AND credit.credited = 'true' AND credit.role = 'technical advisor'