Chinastark/bird_dataset huggingface dataset:
Database: talkingdata
Question: Calculate the percentage of male users among all device users.
Evidence: percentage = DVIDE(SUM(gender = 'M'), COUNT(device_id)); male refers to gender = 'M';
SQL: SELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per FROM gender_age
Database: talkingdata
Question: How many events were participated by the users at longitude of "-156"?
SQL: SELECT COUNT(event_id) FROM events WHERE longitude = -156
Database: talkingdata
Question: How many app users belong to label ID of "48"?
SQL: SELECT COUNT(app_id) FROM app_labels WHERE label_id = 48
Database: talkingdata
Question: How many category names start with the word "game"?
Evidence: category names refers to category; start with the word game refers to category like 'game%';
SQL: SELECT COUNT(label_id) FROM label_categories WHERE category LIKE 'game%'
Database: talkingdata
Question: Provide the number of events participated by the device users at coordinates of (80,37).
Evidence: coordinates of (80,37) refers to longitude = 80 and latitude = 37;
SQL: SELECT COUNT(event_id) FROM events WHERE longitude = 80 AND latitude = 37
Database: talkingdata
Question: List down the labels' IDs and categories of the app ID "5758400314709850000".
SQL: SELECT T1.label_id, T2.category FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T1.app_id = 5758400314709850000
Database: talkingdata
Question: List down the app IDs under the category of game-Rowing .
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 = 'game-Rowing'
Database: talkingdata
Question: What are the label IDs and app IDs of the Chinese Classical Mythology category?
SQL: SELECT T1.label_id, T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Chinese Classical Mythology'
Database: talkingdata
Question: Describe the number of app IDs and location of the event ID "79641".
Evidence: location = longitude, latitude;
SQL: SELECT COUNT(T1.app_id), T2.longitude, T2.latitude FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 79641 GROUP BY T2.longitude, T2.latitude
Database: talkingdata
Question: Provide the locations and times of the events of app ID "8715964299802120000".
Evidence: locations = longitude, latitude; times of the events refers to timestamp;
SQL: SELECT T1.longitude, T1.latitude, T1.timestamp FROM events AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.app_id = 8715964299802120000
Database: talkingdata
Question: How many OPPO users participated in events which were held around 12 AM on 1st May,2016?
Evidence: OPPO refers to phone_brand = 'OPPO'; around 12 AM on 1st May, 2016 refers to timestamp is '2016-05-01'
SQL: SELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' AND STRFTIME('%Y-%m-%d', T1.`timestamp`) = '2016-05-01'
Database: talkingdata
Question: What is the ratio of male and female users of vivo X5pro model?
Evidence: ratio = DIVIDE(SUM(gender = 'M' WHERE device_model = 'X5Pro'), SUM(gender = 'F' WHERE device_model = 'X5Pro')); male refers to gender = 'M'; female refers to gender = 'F'; vivo X5pro model refers to phone_brand = 'vivo' AND device_model = 'X5Pro';
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' AND T2.device_model = 'X5Pro'
Database: talkingdata
Question: How many females use ZUK Z1 phones in the age group under 23?
Evidence: females refers to gender = 'F'; ZUK Z1 refers to phone_brand = 'ZUK' AND device_model = 'Z1'; under 23 refers to `group` = 'F23-' ;
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 T1.gender = 'F' AND T2.device_model = 'Z1' AND T1.`group` = 'F23-' AND T2.phone_brand = 'ZUK'
Database: talkingdata
Question: List the phone brands and models of the users under 10 years of age.
Evidence: models refers to device_model; under 10 years of age refers to age < 10;
SQL: SELECT T2.phone_brand, 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.age < 10
Database: talkingdata
Question: Among the HTC users, calculate the percentage of female users who are over 80.
Evidence: HTC refers to phone_brand = 'HTC'; percentage = DIVIDE(SUM(gender = 'F' AND age > 80), COUNT(device_id)); female refers to gender = 'F'; over 80 refers to age > 80
SQL: SELECT SUM(IIF(T1.gender = 'F' AND T1.age > 80, 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 = 'HTC'
Database: talkingdata
Question: Which phone brand and model was used for event ID "6701"?
Evidence: model refers to device_model;
SQL: SELECT T2.phone_brand, T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.event_id = 6701
Database: talkingdata
Question: Between device ID of "-9215352913819630000" and "-9222956879900150000", mention the age and gender of device user who participated more events.
Evidence: more events refers to MAX(COUNT(event_id));
SQL: SELECT T.age, T.gender FROM ( SELECT T2.age, T2.gender, COUNT(T1.device_id) AS num FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id BETWEEN -9215352913819630000 AND -9222956879900150000 GROUP BY T2.age, T2.gender ) AS T ORDER BY T.num DESC LIMIT 1
Database: talkingdata
Question: List out the time of the event id 12.
Evidence: time refers to timestamp;
SQL: SELECT timestamp FROM events WHERE event_id = 12
Database: talkingdata
Question: How many active users are there in the event?
Evidence: active refers to is_active = 1;
SQL: SELECT COUNT(app_id) FROM app_events WHERE is_active = 1
Database: talkingdata
Question: How many devices belong to model "A51"?
Evidence: model refers to device_model; device_model = 'A51';
SQL: SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51'
Database: talkingdata
Question: State the gender of users who use the device "-9222956879900150000".
Evidence: device refers to device_id; device_id = -9222956879900150000;
SQL: SELECT gender FROM gender_age WHERE device_id = -9222956879900150000
Database: talkingdata
Question: How many labels belong to the game-card category?
Evidence: labels refers to label_id;
SQL: SELECT COUNT(label_id) FROM label_categories WHERE category = 'game-card'
Database: talkingdata
Question: What is the age group of users who use phone brand of vivo?
Evidence: age group refers to group;
SQL: 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 = 'vivo'
Database: talkingdata
Question: How many users who are under 30 years old use device model of Galaxy Note 2?
Evidence: under 30 refers to age < 30;
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 Note 2' AND T1.age < 30
Database: talkingdata
Question: Among the users who use OPPO, calculate the percentage of those who are under 50 years old.
Evidence: OPPO refers to phone_brand = 'OPPO'; percentage = MULTIPLY(DIVIDE(SUM(age < 50), COUNT(device_id)), 1.0); under 50 years old refers to age < 50;
SQL: SELECT SUM(IIF(T1.age < 50, 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 = 'OPPO'
Database: talkingdata
Question: What is the average age of the users who use model device of R7?
Evidence: average age = AVG(age);
SQL: SELECT SUM(T1.age) / COUNT(T1.device_id) AS avg FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'R7'
Database: talkingdata
Question: What is the category of the label that represented the behavior category of app id 5902120154267990000?
Evidence: label that represented the behavior category refers to label_id;
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 = 5902120154267990000
Database: talkingdata
Question: Mention the group of age of users who use phone brand of LG.
Evidence: group of age refers to group;
SQL: 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'
Database: talkingdata
Question: State the category of the label that represented the behavior category of app id 4955831798976240000.
Evidence: label that represented the behavior category refers to label_id;
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 = 4955831798976240000
Database: talkingdata
Question: How many female users use device model of MI 3?
Evidence: female refers to gender = 'F';
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 T1.gender = 'F' AND T2.device_model = 'MI 3'
Database: talkingdata
Question: Among the male users, how many users use device model of Desire 820?
Evidence: male refers to gender = 'M';
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 = 'Desire 820' AND T1.gender = 'M'
Database: talkingdata
Question: Among the users who are above 20, how many users use device model of ELIFE E7 Mini?
Evidence: above 20 refers to age > 20;
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 = 'ELIFE E7 Mini' AND T1.age > 20
Database: talkingdata
Question: State the number of users who are under 50 and above 20 use device model of Galaxy Premier.
Evidence: under 50 and above 20 refers to age BTWEEEN 20 AND 50;
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 T1.age BETWEEN 20 AND 50 AND T2.device_model = 'Galaxy Premier'
Database: talkingdata
Question: Give the number of male users who use phone branded HTC.
Evidence: male refers to gender = 'M';
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 T1.gender = 'M' AND T2.phone_brand = 'HTC'
Database: talkingdata
Question: How many users who are between 20 and 60 use phone brand of TCL?
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 T1.age BETWEEN 20 AND 60 AND T2.phone_brand = 'TCL'
Database: talkingdata
Question: Among the users who use SUGAR, calculate the percentage of those who are above 20 years old.
Evidence: 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;
SQL: 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'
Database: talkingdata
Question: Indicate the location of all the events that occurred on April 30, 2016.
Evidence: location = longitude, latitude; on April 30, 2016 refers timestamp BETWEEN '2016-04-30 00:00:00' AND '2016-04-30 23:59:59';
SQL: SELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30'
Database: talkingdata
Question: How many different models does the HTC brand have?
Evidence: models refers to device_model; HTC brand refers to phone_brand = 'HTC';
SQL: SELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC'
Database: talkingdata
Question: Identify all installed and activated apps by their id.
Evidence: installed refers to is_installed = 1; activated refers to is_active = 1; id refers to app_id;
SQL: SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1
Database: talkingdata
Question: How many apps are labeled 7?
Evidence: labeled 7 refers to label_id = 7;
SQL: SELECT COUNT(app_id) FROM app_labels WHERE label_id = 7
Database: talkingdata
Question: Identify by their id all the devices that are used by women who are in the age range of 29 to 31 years.
Evidence: id refers to device_id; women refers to gender = 'F'; age range of 29 to 31 years refers to age between 29 and 31;
SQL: SELECT device_id FROM gender_age_train WHERE age BETWEEN 29 AND 31 AND gender = 'F'
Database: talkingdata
Question: Identify by their id all the apps that belong to the game-stress reliever category.
Evidence: id refers to device_id;
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 = 'game-stress reliever'
Database: talkingdata
Question: On what date were the most events logged on devices for 40-year-old male users?
Evidence: date refers to timestamp; most events refers to MAX(COUNT(event_id)); 40-year-old  refers to age = 40; male refers to gender = 'M';
SQL: 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
Database: talkingdata
Question: On which brand of phone are the most applications installed?
Evidence: brand of phone refers to phone_brand; most applications are installed refers to MAX(COUNT(is_installed = 1));
SQL: 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_active = 1 GROUP BY T1.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1
Database: talkingdata
Question: How many men under the age of 23 have apps installed but are not active on their devices?
Evidence: 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;
SQL: 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
Database: talkingdata
Question: How many women have apps from the game-Finding fault category installed on their device?
Evidence: women refers to gender = 'F'; installed refers to is_installed = 1;
SQL: 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
Database: talkingdata
Question: Which gender logged in the most to an event in the first 10 days of May 2016?
Evidence: 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';
SQL: 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
Database: talkingdata
Question: What age group is the most using SM-T2558 model phones?
Evidence: 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';
SQL: 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
Database: talkingdata
Question: How many people over the age of 50 do not have HTC One M8 Eye phones?
Evidence: 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';
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 T1.age > 50 AND T2.device_model != 'One M8 Eye' AND T2.phone_brand != 'HTC'
Database: talkingdata
Question: Locate all events on devices of women under 30 years old.
Evidence: locate = longitude, latitude; women refers to gender = 'F'; under 30 years old refers to age < 30;
SQL: 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
Database: talkingdata
Question: What percentage of women do not have applications installed on their mobile with respect to men?
Evidence: 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';
SQL: 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
Database: talkingdata
Question: Calculate the average age of people who have apps installed but are not active on their devices.
Evidence: average age = AVG(age); installed refers to is_installed = 1; not active refers to is_active = 0;
SQL: 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
Database: talkingdata
Question: Please list any three events that happened on the 1st of May 2016 that have the same latitude of 31.
Evidence: on the 1st of May 2016 refers to timestamp like '2016-05-01%';
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
Question: What is the difference between the events of device number -9222956879900150000 that can be located and those that are unable to be located?
Evidence: 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;
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
Question: Please list any three devices that are owned by female users.
Evidence: female refers to gender = 'F';
SQL: SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3
Database: talkingdata
Question: Please list any five app categories that are related to games, along with their label ID.
Evidence: app categories refers to category; related to games refers to category like '%game%';
SQL: SELECT category, label_id FROM label_categories WHERE category LIKE '%game%' LIMIT 5
Database: talkingdata
Question: Please list any three OPPO device models.
Evidence: OPPO refers to phone_brand = 'OPPO';
SQL: SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 3
Database: talkingdata
Question: What is the percentage of users who experienced event number 6 who have the app installed but do not use the app?
Evidence: 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;
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
Question: Which gender owned more of the Galaxy Note 2 device model?
Evidence: gender that owned more = SUBTRACT(IF(SUM(gender = 'M'), SUM(gender = 'F'),'M','F'));
SQL: 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'
Database: talkingdata
Question: When did event number 2 happen and how many users were active?
Evidence: event number refers to event_id; event_id = 2; active refers to is_active = 1;
SQL: 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
Database: talkingdata
Question: Which behavior category does user number 5902120154267990000 belong to?
Evidence: behavior category refers to category; number refers to app_id; app_id = 5902120154267990000;
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 = 5902120154267990000
Database: talkingdata
Question: How many users belong to the same behavior category as comics?
Evidence: behavior category refers to category; category = 'comics';
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 = 'comics'
Database: talkingdata
Question: What is the age and gender of the person who uses the device number 29182687948017100 on event number 1?
Evidence: device number refers to device_id; device_id = 29182687948017100; event number refers to event_id; and event_id = 1;
SQL: 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
Database: talkingdata
Question: How many male users have the log of events at the same longitude of 114?
Evidence: male refers to gender = 'M';
SQL: 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'
Database: talkingdata
Question: When did event number 7 happen for user number -8022267440849930000?
Evidence: event number refers to event_id; event_id = 7; user number refers to app_id; app_id = -8022267440849930000;
SQL: 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
Database: talkingdata
Question: What are the behavior categories that user number -9222198347540750000 belongs to?
Evidence: behavior categories refers to category; user number refers to app_id; app_id = -9222198347540750000;
SQL: 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
Database: talkingdata
Question: Please provide the age group of any LG Nexus 4 device users.
Evidence: age group refers to `group`; LG Nexus 4 refers to phone_brand = 'LG' AND device_model = 'Nexus 4';
SQL: 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'
Database: talkingdata
Question: Please provide the gender of at least one user who owns an HTC Desire 826 device.
Evidence: HTC Desire 826 refers to phone_brand = 'HTC' AND device_model = 'Desire 826';
SQL: 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'