Identify all installed and activated apps by their id.
installed refers to is_installed = 1; activated refers to is_active = 1; id refers to app_id;
SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1