1sf/bird-sql-train-with-schema huggingface dataset:
Database: talkingdata
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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
Tables: app_all, app_events, app_events_relevant, app_labels, events, events_relevant, gender_age, gender_age_test, gender_age_train, label_categories, phone_brand_device_model2, sample_submission
Columns (table index, column name): -1, *, 0, app_id, 1, event_id, 1, app_id, 1, is_installed, 1, is_active, 2, event_id, 2, app_id, 2, is_installed, 2, is_active, 3, app_id, 3, label_id, 4, event_id, 4, device_id, 4, timestamp, 4, longitude, 4, latitude, 5, event_id, 5, device_id, 5, timestamp, 5, longitude, 5, latitude, 6, device_id, 6, gender, 6, age, 6, group, 7, device_id, 8, device_id, 8, gender, 8, age, 8, group, 9, label_id, 9, category, 10, device_id, 10, phone_brand, 10, device_model, 11, device_id, 11, F23-, 11, F24-26, 11, F27-28, 11, F29-32, 11, F33-42, 11, F43+, 11, M22-, 11, M23-26, 11, M27-28, 11, M29-31, 11, M32-38, 11, M39+
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'