db_id stringclasses 69
values | schema stringclasses 69
values | m_schema stringclasses 69
values | question stringlengths 24 325 | sql stringlengths 23 804 | evidence stringlengths 0 673 |
|---|---|---|---|---|---|
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the average age of all the vivo device users? | 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' | average age = AVG(age); vivo device refers to phone_brand = 'vivo'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many female users belong to the age group of 27 to 28? | SELECT COUNT(device_id) FROM gender_age WHERE `group` = 'F27-28' AND gender = 'F' | female refers to gender = 'F'; age group of 27 to 28 refers to `group` = 'F27-28'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the age of the oldest male user of the app? | SELECT MAX(age) FROM gender_age WHERE gender = 'M' | oldest user refers to MAX(age); male refers to gender = 'M'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many users installed the app but are not active? | SELECT COUNT(app_id) FROM app_events WHERE is_installed = 1 AND is_active = 0 | installed refers to is_installed = 1; not active refers to is_active = 0; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the age of the youngest female user of the app? | SELECT MIN(age) FROM gender_age WHERE gender = 'F' | youngest user refers to MIN(age); female refers to gender = 'F'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many models does the VIVO phone brand released? | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo' | models refers to device_model; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List at least 15 phone models released under the OPPO brand. | SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 15 | phone models refers to device_model; OPPO brand refers to phone_brand = 'OPPO'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List at least 10 device models that male users over the age of 39 usually use. | 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 | male refers to gender = 'M'; over the age of 39 refers to group = 'M39+'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List 5 device models that users use to install the app and are active in using the app. | 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 | install refers to is_installed = 1; active refers to is_active = 1; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many users belong to "Financial Information" category? | 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' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many users belong to "game-Art Style" category? | 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' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Provide the total number of the male users that use OPPO as their phone brand. | 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' | male refers to gender = 'Male'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the brand of the youngest user's device? | 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 ) ) | brand of the device refers to phone_brand; youngest user refers to MIN(age); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List at least 3 categories with the lowest number of users. | 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 | lowest number of users refers to MIN(COUNT(label_id)); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many male users use the Galaxy Ace Plus model? | 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' | male refers to gender = 'M'; Galaxy Ace Plus refers to device_model = 'Galaxy Ace Plus'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the age group of most OPPO users? | 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 | age group refers to group; most OPPO users refers to MAX(COUNT(phone_brand = 'OPPO')); OPPO users refers to phone_brand = 'OPPO'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List at least 5 device models that are commonly used by female users. | 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 | device models that are commonly used refers to MAX(COUNT(device_model)); female refers to gender = 'F'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Calculate the ratio in percentage between the average number of app users belonging to "80s Japanese comic" and "90s Japanese comic". | 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 | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | 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? | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the phone brand of the device model "坚果手机"? | SELECT phone_brand FROM phone_brand_device_model2 WHERE device_model = '坚果手机' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Give the number of device models for "中兴" phone brand. | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = '中兴' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Which group does age 24 belong to? | SELECT `group` FROM gender_age WHERE age = '24' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Give the time stamp for event No.887711. | SELECT timestamp FROM events WHERE event_id = '887711' | event no. refers to event_id; event_id = '887711'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Provide the number of events that happened on 2016/5/6. | SELECT COUNT(event_id) FROM events WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-06' | on 2016/5/6 refers to timestamp = '2016/5/6 XX:XX:XX'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | 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. | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Give the number of "game-Fishing" apps. | 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' | game-Fishing refers to category = 'game-Fishing'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | State the number of the "魅蓝Note 2" users who are in the "F29-32" group. | 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' | 魅蓝Note 2 refers to device_model = '魅蓝Note 2'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Give the number of 30-year-old users who were active in the events on 2016/5/2. | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | For the event which happened at 23:33:34 on 2016/5/6, how many installed apps were involved? | 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' | at 23:33:34 on 2016/5/6 refers to timestamp = '2016/5/6 23:33:34'; installed refers to is_installed = '1'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Give the number of female users of "E派" brand devices. | 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派' | female refers to gender = 'F'; E派 brand refers to phone_brand = 'E派'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many male users of the "Galaxy S5" device model? | 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' | male refers to gender = 'M'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many users from the group "F29-32" who were active in the events on 2016/5/7? | 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' | active users refers to is_active = '1'; on 2016/5/7 refers to timestamp = '2016/5/7 XX:XX:XX'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Which category does the app id No.894384172610331000 belong to? | 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' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | For the event which happened at 14:09:49 on 2016/5/6, in the location coordinate(116, 40), how many apps were active? | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | 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? | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many devices are of the brand vivo? | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo' | brand vivo refers to phone_brand = 'vivo'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many more devices are there of the brand vivo than of the brand LG? | SELECT SUM(IIF(phone_brand = 'vivo', 1, 0)) - SUM(IIF(phone_brand = 'LG', 1, 0)) AS num FROM phone_brand_device_model2 | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the ID of the device used by the youngest user? | SELECT device_id FROM gender_age WHERE age = ( SELECT MIN(age) FROM gender_age ) | ID of the device refers to device_id; youngest user refers to MIN(age); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the female users of the devices, how many of them are over 30? | SELECT COUNT(device_id) FROM gender_age WHERE age > 30 AND gender = 'F' | female refers to gender = 'F'; over 30 refers to age > 30; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Is the oldest device user male or female? | SELECT gender FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age ) | 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; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the age of the youngest female device user? | SELECT MIN(age) FROM gender_age WHERE gender = 'F' | youngest refers to MIN(age); female refers to gender = 'F'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among all the users who use a vivo device, what is the age of the youngest user? | 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 | vivo device refers to phone_brand = 'vivo'; youngest refers to MIN(age); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Please list the app IDs of all the users in the Securities category. | 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' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | For the device with an event occurring on 2016/5/1 at 0:55:25, what is the gender of its user? | 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' | on 2016/5/1 at 0:55:25 refers to timestamp = '2016-05-01 00:55:25'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the devices with an event occurring in 2016, how many of them are owned by a user in the M23-26 user group? | 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' | in 2016 refers to year(timestamp) = 2016; M23-26 user group refers to `group` = 'M23-26'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the brand of the device used by the most users in the M23-26 user group? | 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 | brand of the device refers to phone_brand; M23-26 user group refers to `group` = 'M23-26'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Please list the location coordinates of all the Galaxy Note 2 devices when an event happened. | 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' | location coordinates = longitude, latitude; Galaxy Note 2 refers to device_model = 'Galaxy Note 2'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Please list all the models of the devices used by a female user. | 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' | models of the devices refers to device_model; female refers to gender = 'F'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What are the categories that app user ID7324884708820020000 belongs to? | 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 | app user ID refers to app_id; app_id = 7324884708820020000; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | 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? | 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 | not active refers to is_active = 0; event no. refers to event_id; event_id = 2; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many categories in total do the app users who were not active when event no.2 happened belong to? | 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 | not active refers to is_active = 0; event no. refers to event_id; event_id = 2; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the device model used by the most female users over 30? | 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 | female users refers to gender = 'F'; most female users refers to MAX(COUNT(gender = 'F')); over 30 refers to age > 30; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Please list the models of all the devices with an event under the location coordinates (121, 31). | 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 | models of the devices refers to device_model; location coordinates (121, 31) refers to longitude = 121 AND latitude = 31; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What are the top 3 categories with the most app users? | 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 | most app users refers to MAX(COUNT(app_id)); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Please list the event IDs of the events that have happened on the device of the oldest user. | 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 | oldest user refers to MAX(age); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many events have happened on the device of the youngest female user? | 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 | youngest refers to MIN(age); female refers to gender = 'F'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the devices on which an event happened on 2016/5/1, how many of them are used by a male user? | 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' | on 2016/5/1 refers to timestamp = '2016-05-01'; male refers to gender = 'M'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Which category has more app users, Securities or Finance? | 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 | more app users refers to SUBTRACT(IF(SUM(category = 'Securities'), SUM(category = 'Finance')) > 0,'Securities','Finance') as more; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Please list the device models of all the devices used by a user in the M23-26 user group. | 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' | M23-26 user group refers to `group` = 'M23-26'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the average age of the female users who uses a vivo device? | 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' | average age = AVG(age); female refers to gender = 'F'; vivo device refers to phone_brand = 'vivo'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the ratio of female users to male users who uses a vivo device? | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | 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? | 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 | ratio = DIVIDE(SUM(category = 'Securities'), SUM(category = 'Finance')); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the label ID of "Third-party card management" category? | SELECT label_id FROM label_categories WHERE category = 'Third-party card management' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the ratio of active and inactive app users of the event ID "58"? | SELECT SUM(IIF(is_active = 1, 1, 0)) / SUM(IIF(is_active = 0, 1, 0)) AS per FROM app_events WHERE event_id = 58 | ratio = DIVIDE(SUM(is_active = 1), SUM(is_active = 0)); active refers to is_active = 1; inactive refers to is_active = 0; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many events did the device ID "3915082290673130000" join? | SELECT COUNT(event_id) FROM events WHERE device_id = 3915082290673130000 | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Calculate the percentage of male users among all device users. | SELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per FROM gender_age | percentage = DVIDE(SUM(gender = 'M'), COUNT(device_id)); male refers to gender = 'M'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many events were participated by the users at longitude of "-156"? | SELECT COUNT(event_id) FROM events WHERE longitude = -156 | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many app users belong to label ID of "48"? | SELECT COUNT(app_id) FROM app_labels WHERE label_id = 48 | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many category names start with the word "game"? | SELECT COUNT(label_id) FROM label_categories WHERE category LIKE 'game%' | category names refers to category; start with the word game refers to category like 'game%'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Provide the number of events participated by the device users at coordinates of (80,37). | SELECT COUNT(event_id) FROM events WHERE longitude = 80 AND latitude = 37 | coordinates of (80,37) refers to longitude = 80 and latitude = 37; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List down the labels' IDs and categories of the app ID "5758400314709850000". | 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 | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List down the app IDs under the category of game-Rowing . | 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' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What are the label IDs and app IDs of the Chinese Classical Mythology category? | 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' | |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Describe the number of app IDs and location of the event ID "79641". | 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 | location = longitude, latitude; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Provide the locations and times of the events of app ID "8715964299802120000". | 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 | locations = longitude, latitude; times of the events refers to timestamp; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many OPPO users participated in events which were held around 12 AM on 1st May,2016? | 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' | OPPO refers to phone_brand = 'OPPO'; around 12 AM on 1st May, 2016 refers to timestamp is '2016-05-01' |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the ratio of male and female users of vivo X5pro model? | 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' | 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'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many females use ZUK Z1 phones in the age group under 23? | 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' | females refers to gender = 'F'; ZUK Z1 refers to phone_brand = 'ZUK' AND device_model = 'Z1'; under 23 refers to `group` = 'F23-' ; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List the phone brands and models of the users under 10 years of age. | 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 | models refers to device_model; under 10 years of age refers to age < 10; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the HTC users, calculate the percentage of female users who are over 80. | 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' | 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 |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Which phone brand and model was used for event ID "6701"? | 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 | model refers to device_model; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Between device ID of "-9215352913819630000" and "-9222956879900150000", mention the age and gender of device user who participated more events. | 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 | more events refers to MAX(COUNT(event_id)); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | List out the time of the event id 12. | SELECT timestamp FROM events WHERE event_id = 12 | time refers to timestamp; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many active users are there in the event? | SELECT COUNT(app_id) FROM app_events WHERE is_active = 1 | active refers to is_active = 1; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many devices belong to model "A51"? | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51' | model refers to device_model; device_model = 'A51'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | State the gender of users who use the device "-9222956879900150000". | SELECT gender FROM gender_age WHERE device_id = -9222956879900150000 | device refers to device_id; device_id = -9222956879900150000; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many labels belong to the game-card category? | SELECT COUNT(label_id) FROM label_categories WHERE category = 'game-card' | labels refers to label_id; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the age group of users who use phone brand of vivo? | 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' | age group refers to group; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many users who are under 30 years old use device model of Galaxy Note 2? | 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 | under 30 refers to age < 30; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the users who use OPPO, calculate the percentage of those who are under 50 years old. | 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' | 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; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the average age of the users who use model device of R7? | 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' | average age = AVG(age); |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | What is the category of the label that represented the behavior category of app id 5902120154267990000? | 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 | label that represented the behavior category refers to label_id; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Mention the group of age of users who use phone brand of LG. | 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' | group of age refers to group; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | State the category of the label that represented the behavior category of app id 4955831798976240000. | 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 | label that represented the behavior category refers to label_id; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many female users use device model of MI 3? | 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' | female refers to gender = 'F'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the male users, how many users use device model of Desire 820? | 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' | male refers to gender = 'M'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Among the users who are above 20, how many users use device model of ELIFE E7 Mini? | 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 | above 20 refers to age > 20; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | State the number of users who are under 50 and above 20 use device model of Galaxy Premier. | 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' | under 50 and above 20 refers to age BTWEEEN 20 AND 50; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | Give the number of male users who use phone branded HTC. | 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' | male refers to gender = 'M'; |
talkingdata | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `ev... | 【DB_ID】 talkingdata
【Schema】
# Table: main.app_all
[
(app_id:INTEGER, Primary Key, Examples: [-9223281467940916832, -9222877069545393219, -9222785464897897681])
]
# Table: main.app_events
[
(event_id:INTEGER, Primary Key, Examples: [2, 6, 7]),
(app_id:INTEGER, Primary Key, Examples: [-8942695423876075857, -802226744084... | How many users who are between 20 and 60 use phone brand of TCL? | 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' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.