### Database Schema:
CREATE TABLE gender_age_test (
	device_id	INTEGER	NOT NULL	PRIMARY KEY
);

CREATE TABLE sample_submission (
	device_id	INTEGER	NOT NULL	PRIMARY KEY,
	`F23-`	REAL	NULL	DEFAULT NULL,
	`F24-26`	REAL	NULL	DEFAULT NULL,
	`F27-28`	REAL	NULL	DEFAULT NULL,
	`F29-32`	REAL	NULL	DEFAULT NULL,
	`F33-42`	REAL	NULL	DEFAULT NULL,
	`F43+`	REAL	NULL	DEFAULT NULL,
	`M22-`	REAL	NULL	DEFAULT NULL,
	`M23-26`	REAL	NULL	DEFAULT NULL,
	`M27-28`	REAL	NULL	DEFAULT NULL,
	`M29-31`	REAL	NULL	DEFAULT NULL,
	`M32-38`	REAL	NULL	DEFAULT NULL,
	`M39+`	REAL	NULL	DEFAULT NULL
);

CREATE TABLE events_relevant (
	event_id	INTEGER	NOT NULL	PRIMARY KEY,
	device_id	INTEGER	NULL	DEFAULT NULL,
	timestamp	DATETIME	NOT NULL,
	longitude	REAL	NOT NULL,
	latitude	REAL	NOT NULL,
	foreign key (device_id) references gender_age (device_id)
);

CREATE TABLE app_all (
	app_id	INTEGER	NOT NULL	PRIMARY KEY
);

CREATE TABLE app_labels (
	app_id	INTEGER	NOT NULL,
	label_id	INTEGER	NOT NULL,
	foreign key (app_id) references app_all (app_id),
	foreign key (label_id) references label_categories (label_id)
);

CREATE TABLE gender_age_train (
	device_id	INTEGER	NOT NULL	PRIMARY KEY,
	gender	TEXT	NULL	DEFAULT NULL,
	age	INTEGER	NULL	DEFAULT NULL,
	group	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE events (
	event_id	INTEGER	NOT NULL	PRIMARY KEY,
	device_id	INTEGER	NULL	DEFAULT NULL,
	timestamp	DATETIME	NULL	DEFAULT NULL,
	longitude	REAL	NULL	DEFAULT NULL,
	latitude	REAL	NULL	DEFAULT NULL
);

CREATE TABLE gender_age (
	device_id	INTEGER	NOT NULL	PRIMARY KEY,
	gender	TEXT	NULL	DEFAULT NULL,
	age	INTEGER	NULL	DEFAULT NULL,
	group	TEXT	NULL	DEFAULT NULL,
	foreign key (device_id) references phone_brand_device_model2 (device_id)
);

CREATE TABLE phone_brand_device_model2 (
	device_id	INTEGER	NOT NULL	PRIMARY KEY,
	phone_brand	TEXT	NOT NULL	PRIMARY KEY,
	device_model	TEXT	NOT NULL	PRIMARY KEY
);

CREATE TABLE app_events_relevant (
	event_id	INTEGER	NOT NULL	PRIMARY KEY,
	app_id	INTEGER	NOT NULL	PRIMARY KEY,
	is_installed	INTEGER	NULL	DEFAULT NULL,
	is_active	INTEGER	NULL	DEFAULT NULL,
	foreign key (app_id) references app_all (app_id),
	foreign key (event_id) references events_relevant (event_id)
);

CREATE TABLE label_categories (
	label_id	INTEGER	NOT NULL	PRIMARY KEY,
	category	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE app_events (
	event_id	INTEGER	NOT NULL	PRIMARY KEY,
	app_id	INTEGER	NOT NULL	PRIMARY KEY,
	is_installed	INTEGER	NOT NULL,
	is_active	INTEGER	NOT NULL,
	foreign key (event_id) references events (event_id)
);

### User's Query:
For the event which happened at 23:33:34 on 2016/5/6, how many installed apps were involved?

### Extra Knowledge:
at 23:33:34 on 2016/5/6 refers to timestamp = '2016/5/6 23:33:34'; installed refers to is_installed = '1';
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'