list_segments = """
    SELECT
        count(*) FILTER (
            WHERE last_activity_timestamp >= NOW() - '90 days'::interval
                AND (
                    last_3_events_timestamp IS NULL
                    OR last_3_events_timestamp < NOW() - '90 days'::interval
                )
        ) AS prospective_count,
        count(*) FILTER (
            WHERE last_3_events_timestamp >= NOW() - '90 days'::interval
        ) AS active_count,
        count(*) FILTER (
            WHERE last_activity_timestamp < NOW() - '90 days'::interval
        ) AS lost_count,
        count(*) FILTER (WHERE last_review_rating >= '4') AS loyal_count,
        count(*) FILTER (WHERE last_review_rating < '4') AS disloyal_count,
        count(*) AS total_leads
    FROM events_stat_precalced
    WHERE biz_id = $1
"""
