CREATE TABLE `app_all`
(
    `app_id` INTEGER NOT NULL,
    PRIMARY KEY (`app_id`)
);
app_all
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 `events` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE
);
app_events
CREATE TABLE `app_events_relevant` (
  `event_id` INTEGER NOT NULL,
  `app_id` INTEGER NOT NULL,
  `is_installed` INTEGER DEFAULT NULL,
  `is_active` INTEGER DEFAULT NULL,
  PRIMARY KEY (`event_id`,`app_id`),
  FOREIGN KEY (`event_id`) REFERENCES `events_relevant` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  FOREIGN KEY (`app_id`) REFERENCES `app_all` (`app_id`) ON DELETE CASCADE ON UPDATE CASCADE
);
app_events_relevant
CREATE TABLE `app_labels` (
  `app_id` INTEGER NOT NULL,
  `label_id` INTEGER NOT NULL,
  FOREIGN KEY (`label_id`) REFERENCES `label_categories` (`label_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  FOREIGN KEY (`app_id`) REFERENCES `app_all` (`app_id`) ON DELETE CASCADE ON UPDATE CASCADE
);
app_labels
CREATE TABLE `events` (
  `event_id` INTEGER NOT NULL,
  `device_id` INTEGER DEFAULT NULL,
  `timestamp` DATETIME DEFAULT NULL,
  `longitude` REAL DEFAULT NULL,
  `latitude` REAL DEFAULT NULL,
  PRIMARY KEY (`event_id`)
);
events
CREATE TABLE `events_relevant` (
  `event_id` INTEGER NOT NULL,
  `device_id` INTEGER DEFAULT NULL,
  `timestamp` DATETIME NOT NULL,
  `longitude` REAL NOT NULL,
  `latitude` REAL NOT NULL,
  PRIMARY KEY (`event_id`),
  FOREIGN KEY (`device_id`) REFERENCES `gender_age` (`device_id`) ON DELETE CASCADE ON UPDATE CASCADE
);
events_relevant
CREATE TABLE `gender_age` (
  `device_id` INTEGER NOT NULL,
  `gender` TEXT DEFAULT NULL,
  `age` INTEGER DEFAULT NULL,
  `group` TEXT DEFAULT NULL,
  PRIMARY KEY (`device_id`),
  FOREIGN KEY (`device_id`) REFERENCES `phone_brand_device_model2` (`device_id`) ON DELETE CASCADE ON UPDATE CASCADE
);
gender_age
CREATE TABLE `gender_age_test` (
  `device_id` INTEGER NOT NULL,
  PRIMARY KEY (`device_id`)
);
gender_age_test
CREATE TABLE `gender_age_train` (
  `device_id` INTEGER NOT NULL,
  `gender` TEXT DEFAULT NULL,
  `age` INTEGER DEFAULT NULL,
  `group` TEXT DEFAULT NULL,
  PRIMARY KEY (`device_id`)
);
gender_age_train
CREATE TABLE `label_categories` (
  `label_id` INTEGER NOT NULL,
  `category` TEXT DEFAULT NULL,
  PRIMARY KEY (`label_id`)
);
label_categories
CREATE TABLE `phone_brand_device_model2` (
  `device_id` INTEGER NOT NULL,
  `phone_brand` TEXT NOT NULL,
  `device_model` TEXT NOT NULL,
  PRIMARY KEY (`device_id`,`phone_brand`,`device_model`)
);
phone_brand_device_model2
CREATE TABLE `sample_submission` (
  `device_id` INTEGER NOT NULL,
  `F23-` REAL DEFAULT NULL,
  `F24-26` REAL DEFAULT NULL,
  `F27-28` REAL DEFAULT NULL,
  `F29-32` REAL DEFAULT NULL,
  `F33-42` REAL DEFAULT NULL,
  `F43+` REAL DEFAULT NULL,
  `M22-` REAL DEFAULT NULL,
  `M23-26` REAL DEFAULT NULL,
  `M27-28` REAL DEFAULT NULL,
  `M29-31` REAL DEFAULT NULL,
  `M32-38` REAL DEFAULT NULL,
  `M39+` REAL DEFAULT NULL,
  PRIMARY KEY (`device_id`)
);
sample_submission
original_column_name,column_name,column_description,data_format,value_description
device_id,device id,unique number of devices,integer,
gender,,gender of the user who uses this device,text,
age,,age of the user who uses this device,integer," M: male;
 F: female"
group,,group of the ages,text,
gender_age
original_column_name,column_name,column_description,data_format,value_description
event_id,,,integer,
app_id,,,integer,
is_installed,,,integer,
is_active,,,integer,
app_events_relevant
original_column_name,column_name,column_description,data_format,value_description
label_id,label id,unique id of label,integer,
category,,category of the label,text,
label_categories
original_column_name,column_name,column_description,data_format,value_description
app_id,,,integer,
app_all
original_column_name,column_name,column_description,data_format,value_description
device_id,,,integer,
gender,,,text,
age,,,integer,
group,,,text,
gender_age_train
original_column_name,column_name,column_description,data_format,value_description
event_id,event id,the id of events,integer,
app_id,app id,the id of app users,integer,each app_id represents for an user
is_installed,is installed,whether this app is installed or not,integer," 0: no
 1: yes: installed"
is_active,is active,whether this user is active or not,integer,
app_events
original_column_name,column_name,column_description,data_format,value_description
device_id,,,integer,
gender_age_test
original_column_name,column_name,column_description,data_format,value_description
event_id,,,integer,
device_id,,,integer,
timestamp,,,datetime,
longitude,,,real,
latitude,,,real,
events_relevant
original_column_name,column_name,column_description,data_format,value_description
event_id,event id,unique id number referring to the event,integer,
device_id,device id,id number referring the device,integer,
timestamp,,the time of the event,datetime,
longitude,,longitude ,real,"commonsense evidence:
the location / coordinate = (longitude, latitude)"
latitude,,latitude,real,
events
original_column_name,column_name,column_description,data_format,value_description
app_id,app id,id of the app user,integer,
label_id,label id,id of labels represents which behavior category that each user belongs to ,integer,
app_labels
original_column_name,column_name,column_description,data_format,value_description
device_id,device id,the id number of the device,integer,
phone_brand,phone brand,phone brand,text,"commonsense evidence:
phone_brand has duplicated values since some device models belong to the same brand"
device_model,device model,device model,text,"commonsense evidence:
phone_brand has duplicated values since some device models belong to the same brand"
phone_brand_device_model2
original_column_name,column_name,column_description,data_format,value_description
device_id,,,integer,
F23-,,,real,
F24-26,,,real,
F27-28,,,real,
F29-32,,,real,
F33-42,,,real,
F43+,,,real,
M22-,,,real,
M23-26,,,real,
M27-28,,,real,
M29-31,,,real,
M32-38,,,real,
M39+,,,real,
sample_submission