Chinastark/bird_dataset huggingface dataset:
Database: talkingdata
Question: What is the brand of the device used by the youngest female user?
Evidence: brand of the device refers to phone_brand; youngest refers to MIN(age); female refers to gender = 'F';
SQL: SELECT phone_brand FROM phone_brand_device_model2 WHERE device_id IN ( SELECT * FROM ( SELECT device_id FROM gender_age WHERE gender = 'F' ORDER BY age LIMIT 1 ) AS T )
Database: talkingdata
Question: How many users in user group M23-26 use a vivo device?
Evidence: user group M23-26 refers to group = 'M23-26'; vivo device refers to phone_brand = 'vivo';
SQL: SELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26' AND T2.phone_brand = 'vivo'
Database: talkingdata
Question: Among all the users who use a vivo device, what is the percentage of the users in the M23-26 user group?
Evidence: vivo device refers to phone_brand = 'vivo'; percentage = MULTIPLY(DIVIDE(COUNT(phone_brand = 'vivo WHERE group = 'M23-26), COUNT(phone_brand = 'vivo)), 100); M23-26 user group refers to group = 'M23-26';
SQL: SELECT SUM(IIF(T1.`group` = 'M23-26', 1.0, 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'
Database: talkingdata
Question: Among all the devices with event no.2 happening, what is the percentage of the device being a vivo phone?
Evidence: event no. refers to event_id; event_id = '2'; percentage = SUM(IF(phone_brand = 'vivo',1,0)), COUNT(device_id) WHERE event_id = '2'; vivo phone refers to phone_brand = 'vivo';
SQL: SELECT SUM(IIF(T2.phone_brand = 'vivo', 1, 0)) / COUNT(T1.device_id) AS per FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.event_id = T2.device_id WHERE T1.event_id = '2'
Database: talkingdata
Question: What is the average age of all the vivo device users?
Evidence: average age = AVG(age); vivo device refers to phone_brand = 'vivo';
SQL: SELECT AVG(age) 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'
Database: talkingdata
Question: How many female users belong to the age group of 27 to 28?
Evidence: female refers to gender = 'F'; age group of 27 to 28 refers to `group` = 'F27-28';
SQL: SELECT COUNT(device_id) FROM gender_age WHERE `group` = 'F27-28' AND gender = 'F'
Database: talkingdata
Question: What is the age of the oldest male user of the app?
Evidence: oldest user refers to MAX(age); male refers to gender = 'M';
SQL: SELECT MAX(age) FROM gender_age WHERE gender = 'M'
Database: talkingdata
Question: How many users installed the app but are not active?
Evidence: installed refers to is_installed = 1; not active refers to is_active = 0;
SQL: SELECT COUNT(app_id) FROM app_events WHERE is_installed = 1 AND is_active = 0
Database: talkingdata
Question: What is the age of the youngest female user of the app?
Evidence: youngest user refers to MIN(age); female refers to gender = 'F';
SQL: SELECT MIN(age) FROM gender_age WHERE gender = 'F'
Database: talkingdata
Question: How many models does the VIVO phone brand released?
Evidence: models refers to device_model;
SQL: SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo'
Database: talkingdata
Question: List at least 15 phone models released under the OPPO brand.
Evidence: phone models refers to device_model; OPPO brand refers to phone_brand = 'OPPO';
SQL: SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 15
Database: talkingdata
Question: List at least 10 device models that male users over the age of 39 usually use.
Evidence: male refers to gender = 'M'; over the age of 39 refers to group = 'M39+';
SQL: SELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.`group` = 'M39+' AND T2.gender = 'M' LIMIT 10
Database: talkingdata
Question: List 5 device models that users use to install the app and are active in using the app.
Evidence: install refers to is_installed = 1; active refers to is_active = 1;
SQL: SELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.event_id INNER JOIN app_events AS T3 ON T2.event_id = T3.event_id WHERE T3.is_active = 1 AND T3.is_installed = 1 LIMIT 5
Database: talkingdata
Question: How many users belong to "Financial Information" category?
SQL: 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 = 'Financial Information'
Database: talkingdata
Question: How many users belong to "game-Art Style" category?
SQL: 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 = 'game-Art Style'
Database: talkingdata
Question: Provide the total number of the male users that use OPPO as their phone brand.
Evidence: male refers to gender = 'Male';
SQL: 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.phone_brand = 'OPPO' AND T1.gender = 'M'
Database: talkingdata
Question: What is the brand of the youngest user's device?
Evidence: brand of the device refers to phone_brand; youngest user refers to MIN(age);
SQL: SELECT device_model FROM phone_brand_device_model2 WHERE device_id IN ( SELECT device_id FROM gender_age WHERE age = ( SELECT MIN(age) FROM gender_age ) )
Database: talkingdata
Question: List at least 3 categories with the lowest number of users.
Evidence: lowest number of users refers to MIN(COUNT(label_id));
SQL: SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id ORDER BY T2.label_id LIMIT 3
Database: talkingdata
Question: How many male users use the Galaxy Ace Plus model?
Evidence: male refers to gender = 'M'; Galaxy Ace Plus refers to device_model = 'Galaxy Ace Plus';
SQL: 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 Ace Plus' AND T1.gender = 'M'
Database: talkingdata
Question: What is the age group of most OPPO users?
Evidence: age group refers to group; most OPPO users refers to MAX(COUNT(phone_brand = 'OPPO')); OPPO users refers to phone_brand = 'OPPO';
SQL: SELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.`group`) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1
Database: talkingdata
Question: List at least 5 device models that are commonly used by female users.
Evidence: device models that are commonly used refers to MAX(COUNT(device_model)); female refers to gender = 'F';
SQL: SELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 5
Database: talkingdata
Question: Calculate the ratio in percentage between the average number of app users belonging to "80s Japanese comic" and "90s Japanese comic".
Evidence: ratio in percentage = DIVIDE(SUM(IF(category = '80s Japanese comic',1,0)), COUNT(app_id)) as '80s'; DIVIDE(SUM(IF(category = '90s Japanese comic',1,0)), COUNT(app_id)) as '90s'; 80s Japanese comic refers to category = '80s Japanese comic'; 90s Japanese comic refers to category = '80s Japanese comic';
SQL: SELECT SUM(IIF(T1.category = '80s Japanese comic', 1, 0)) / COUNT(T1.label_id) AS J8 , SUM(IIF(T1.category = '90s Japanese comic', 1, 0)) / COUNT(T1.label_id) AS J9 FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id
Database: talkingdata
Question: Among the female users that uses OPPO as their phone brand, what is the percentage of them of the user that uses R815T model to install the app?
Evidence: female refers to gender = 'F'; percentage = DIVIDE(SUM(IF(phone_brand = 'OPPO',1,0)), SUM(IF(device_id = 'R815T',1,0))); R815T refers to device_id = 'R815T';
SQL: SELECT SUM(IIF(T1.phone_brand = 'OPPO', 1, 0)) / SUM(IIF(T1.device_id = 'R815T', 1, 0)) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F'
Database: talkingdata
Question: Give the number of device models for "中兴" phone brand.
SQL: SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = '中兴'
Database: talkingdata
Question: Give the time stamp for event No.887711.
Evidence: event no. refers to event_id; event_id = '887711';
SQL: SELECT timestamp FROM events WHERE event_id = '887711'
Database: talkingdata
Question: Provide the number of events that happened on 2016/5/6.
Evidence: on 2016/5/6 refers to timestamp = '2016/5/6 XX:XX:XX';
SQL: SELECT COUNT(event_id) FROM events WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-06'
Database: talkingdata
Question: For the event which happened at 23:55:16 on 2016/5/7, in the location coordinate(113, 28), on what device did it happen? Give the name of the device model.
Evidence: at 23:55:16 on 2016/5/7 refers to timestamp = '2016/5/7 23:55:16'; location coordinate (113, 28) refers to longitude = '113' AND latitude = '28';
SQL: SELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.event_id WHERE T2.longitude = '113' AND T2.latitude = '28' AND T2.timestamp = '2016-05-07 23:55:16'
Database: talkingdata
Question: Give the number of "game-Fishing" apps.
Evidence: game-Fishing refers to category = 'game-Fishing';
SQL: 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 = 'game-Fishing'
Database: talkingdata
Question: State the number of the "魅蓝Note 2" users who are in the "F29-32" group.
Evidence: 魅蓝Note 2 refers to device_model = '魅蓝Note 2';
SQL: SELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'F29-32' AND T2.device_model = '魅蓝Note 2'
Database: talkingdata
Question: Give the number of 30-year-old users who were active in the events on 2016/5/2.
Evidence: 30-year-old refers to age = '30'; active refers to is_active = 1; on 2016/5/2 refers to timestamp = '2016/5/2 XX:XX:XX';
SQL: SELECT COUNT(T3.device_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id INNER JOIN gender_age AS T3 ON T2.device_id = T3.device_id WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-02' AND T1.is_active = 1 AND T3.age = '30'
Database: talkingdata
Question: For the event which happened at 23:33:34 on 2016/5/6, how many installed apps were involved?
Evidence: at 23:33:34 on 2016/5/6 refers to timestamp = '2016/5/6 23:33:34'; installed refers to is_installed = '1';
SQL: SELECT COUNT(T1.event_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE SUBSTR(T2.`timestamp`, 1, 10) = '2016-05-06' AND T1.is_installed = '1'
Database: talkingdata
Question: Give the number of female users of "E派" brand devices.
Evidence: female refers to gender = 'F'; E派 brand refers to phone_brand = 'E派';
SQL: SELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.phone_brand = 'E派'
Database: talkingdata
Question: How many male users of the "Galaxy S5" device model?
Evidence: male refers to gender = 'M';
SQL: SELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_model = 'Galaxy S5' AND T2.gender = 'M'
Database: talkingdata
Question: How many users from the group "F29-32" who were active in the events on 2016/5/7?
Evidence: active users refers to is_active = '1'; on 2016/5/7 refers to timestamp = '2016/5/7 XX:XX:XX';
SQL: SELECT COUNT(T1.app_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id INNER JOIN gender_age AS T3 ON T2.event_id = T3.device_id WHERE SUBSTR(T2.`timestamp`, 1, 10) = '2016-05-07' AND T1.is_active = '1' AND T3.`group` = 'F29-32'
Database: talkingdata
Question: Which category does the app id No.894384172610331000 belong to?
SQL: 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 = '894384172610331000'
Database: talkingdata
Question: For the event which happened at 14:09:49 on 2016/5/6, in the location coordinate(116, 40), how many apps were active?
Evidence: at 14:09:49 on 2016/5/6 refers to timestamp = '2016/5/6 14:09:49'; location coordinate(116, 40) refers to longitude = '116' AND latitude = '40'; active refers to is_active = '1';
SQL: SELECT COUNT(T1.app_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T2.timestamp = '2016-05-06 14:09:49' AND T1.is_active = '1' AND T2.longitude = '116' AND T2.latitude = '40'
Database: talkingdata
Question: How many times is the number of active apps in the event that happened at 7:50:28 on 2016/5/2 than in the event that happened at 7:41:03 on 2016/5/2?
Evidence: how many times = DIVIDE(SUM(IF(timestamp = '2016/5/2 7:50:28', 1,0)), SUM(IF(timestamp = '2016/5/2 7:41:03',1,0))); active refers to is_active = '1'; at 7:50:28 on 2016/5/2 refers to timestamp = '2016/5/2 7:50:28'; at 7:41:03 on 2016/5/2 refers to timestamp = '2016/5/2 7:41:03';
SQL: SELECT SUM(IIF(timestamp = '2016-05-02 7:50:28', 1, 0)) / SUM(IIF(timestamp = '2016-05-02 7:41:03', 1, 0)) AS num FROM events AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.is_active = '1'
Database: talkingdata
Question: How many devices are of the brand vivo?
Evidence: brand vivo refers to phone_brand = 'vivo';
SQL: SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo'
Database: talkingdata
Question: How many more devices are there of the brand vivo than of the brand LG?
Evidence: how many more = SUBTRACT(SUM(IF(phone_brand = 'vivo',1,0)), SUM(IF(phone_brand = 'LG',1,0))); brand vivo refers to phone_brand = 'vivo'; brand LG refers to phone_brand = 'LG';
SQL: SELECT SUM(IIF(phone_brand = 'vivo', 1, 0)) - SUM(IIF(phone_brand = 'LG', 1, 0)) AS num FROM phone_brand_device_model2
Database: talkingdata
Question: What is the ID of the device used by the youngest user?
Evidence: ID of the device refers to device_id; youngest user refers to MIN(age);
SQL: SELECT device_id FROM gender_age WHERE age = ( SELECT MIN(age) FROM gender_age )
Database: talkingdata
Question: Among the female users of the devices, how many of them are over 30?
Evidence: female refers to gender = 'F'; over 30 refers to age > 30;
SQL: SELECT COUNT(device_id) FROM gender_age WHERE age > 30 AND gender = 'F'
Database: talkingdata
Question: Is the oldest device user male or female?
Evidence: MAX(Age) AND gender = 'M' means that the oldest device user is male; MAX(Age) AND gender = 'F' means that the oldest device user is female;
SQL: SELECT gender FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age )
Database: talkingdata
Question: What is the age of the youngest female device user?
Evidence: youngest refers to MIN(age); female refers to gender = 'F';
SQL: SELECT MIN(age) FROM gender_age WHERE gender = 'F'
Database: talkingdata
Question: Among all the users who use a vivo device, what is the age of the youngest user?
Evidence: vivo device refers to phone_brand = 'vivo'; youngest refers to MIN(age);
SQL: SELECT T1.age 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' ORDER BY T1.age LIMIT 1
Database: talkingdata
Question: Please list the app IDs of all the users in the Securities category.
SQL: 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 = 'Securities'
Database: talkingdata
Question: For the device with an event occurring on 2016/5/1 at 0:55:25, what is the gender of its user?
Evidence: on 2016/5/1 at 0:55:25 refers to timestamp = '2016-05-01 00:55:25';
SQL: SELECT T1.gender FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-01 00:55:25'
Database: talkingdata
Question: Among the devices with an event occurring in 2016, how many of them are owned by a user in the M23-26 user group?
Evidence: in 2016 refers to year(timestamp) = 2016; M23-26 user group refers to `group` = 'M23-26';
SQL: SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE STRFTIME('%Y', T2.timestamp) = '2016' AND T1.`group` = 'M23-26'
Database: talkingdata
Question: What is the brand of the device used by the most users in the M23-26 user group?
Evidence: brand of the device refers to phone_brand; M23-26 user group refers to `group` = 'M23-26';
SQL: SELECT T.phone_brand FROM ( SELECT T2.phone_brand, 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 T1.`group` = 'M23-26' GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1
Database: talkingdata
Question: Please list the location coordinates of all the Galaxy Note 2 devices when an event happened.
Evidence: location coordinates = longitude, latitude; Galaxy Note 2 refers to device_model = 'Galaxy Note 2';
SQL: SELECT T1.longitude, T1.latitude FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2'
Database: talkingdata
Question: Please list all the models of the devices used by a female user.
Evidence: models of the devices refers to device_model; female refers to gender = 'F';
SQL: SELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F'
Database: talkingdata
Question: What are the categories that app user ID7324884708820020000 belongs to?
Evidence: app user ID refers to app_id; app_id = 7324884708820020000;
SQL: 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 = 7324884708820020000
Database: talkingdata
Question: Among the app users who were not active when event no.2 happened, how many of them belong to the category Property Industry 1.0?
Evidence: not active refers to is_active = 0; event no. refers to event_id; event_id = 2;
SQL: SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.is_active = 0 AND T1.category = 'Property Industry 1.0' AND T3.event_id = 2
Database: talkingdata
Question: How many categories in total do the app users who were not active when event no.2 happened belong to?
Evidence: not active refers to is_active = 0; event no. refers to event_id; event_id = 2;
SQL: SELECT COUNT(*) FROM ( SELECT COUNT(DISTINCT T1.category) AS result FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0 GROUP BY T1.category ) T
Database: talkingdata
Question: What is the device model used by the most female users over 30?
Evidence: female users refers to gender = 'F'; most female users refers to MAX(COUNT(gender = 'F')); over 30 refers to age > 30;
SQL: SELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) 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 > 30 AND T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 1
Database: talkingdata
Question: Please list the models of all the devices with an event under the location coordinates (121, 31).
Evidence: models of the devices refers to device_model; location coordinates (121, 31) refers to longitude = 121 AND latitude = 31;
SQL: SELECT T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.longitude = 121 AND T1.latitude = 31
Database: talkingdata
Question: What are the top 3 categories with the most app users?
Evidence: most app users refers to MAX(COUNT(app_id));
SQL: SELECT T.category FROM ( SELECT T2.category, COUNT(T1.app_id) AS num FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id GROUP BY T2.category ) AS T ORDER BY T.num DESC LIMIT 3
Database: talkingdata
Question: Please list the event IDs of the events that have happened on the device of the oldest user.
Evidence: oldest user refers to MAX(age);
SQL: SELECT T2.event_id FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id ORDER BY T1.age DESC LIMIT 1
Database: talkingdata
Question: How many events have happened on the device of the youngest female user?
Evidence: youngest refers to MIN(age); female refers to gender = 'F';
SQL: SELECT COUNT(T1.event_id) FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F' GROUP BY T1.event_id, T2.age ORDER BY T2.age LIMIT 1
Database: talkingdata
Question: Among the devices on which an event happened on 2016/5/1, how many of them are used by a male user?
Evidence: on 2016/5/1 refers to timestamp = '2016-05-01'; male refers to gender = 'M';
SQL: SELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.timestamp = '2016-05-01' AND T2.gender = 'M'
Database: talkingdata
Question: Which category has more app users, Securities or Finance?
Evidence: more app users refers to SUBTRACT(IF(SUM(category = 'Securities'), SUM(category = 'Finance')) > 0,'Securities','Finance') as more;
SQL: SELECT IIF(SUM(IIF(T2.category = 'Securities', 1, 0)) - SUM(IIF(T2.category = 'Finance', 1, 0)) > 0, 'Securities', 'Finance') AS diff FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id
Database: talkingdata
Question: Please list the device models of all the devices used by a user in the M23-26 user group.
Evidence: M23-26 user group refers to `group` = 'M23-26';
SQL: SELECT T2.device_model FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26'
Database: talkingdata
Question: What is the average age of the female users who uses a vivo device?
Evidence: average age = AVG(age); female refers to gender = 'F'; vivo device refers to phone_brand = 'vivo';
SQL: SELECT AVG(T1.age) 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' AND T1.gender = 'F'
Database: talkingdata
Question: What is the ratio of female users to male users who uses a vivo device?
Evidence: ratio = DIVIDE(SUM(gender = 'M' WHERE phone_brand = 'vivo'), SUM(gender = 'F' WHERE phone_brand = 'vivo')); female refers to gender = 'F'; male refers to gender = 'M'; vivo device refers to phone_brand = 'vivo';
SQL: SELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) 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'
Database: talkingdata
Question: What is the ratio of the number of app users that belong to the Securities category to the number of app users that belong to the Finance category?
Evidence: ratio = DIVIDE(SUM(category = 'Securities'), SUM(category = 'Finance'));
SQL: SELECT SUM(IIF(T2.category = 'Securities', 1, 0)) / SUM(IIF(T2.category = 'Finance', 1, 0)) AS per FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id
Database: talkingdata
Question: What is the ratio of active and inactive app users of the event ID "58"?
Evidence: ratio = DIVIDE(SUM(is_active = 1), SUM(is_active = 0)); active refers to is_active = 1; inactive refers to is_active = 0;
SQL: SELECT SUM(IIF(is_active = 1, 1, 0)) / SUM(IIF(is_active = 0, 1, 0)) AS per FROM app_events WHERE event_id = 58
Database: talkingdata
Question: How many events did the device ID "3915082290673130000" join?
SQL: SELECT COUNT(event_id) FROM events WHERE device_id = 3915082290673130000