DATE_FORMAT(time_column, 'yyyy-MM-dd') AS date_bucket,
COUNT(DISTINCT user_id) AS active_users,
COUNT(DISTINCT CASE WHEN DATEDIFF(time_column, first_usage_time) = 1 THEN user_id END) / COUNT(DISTINCT user_id) AS retention_rate
WHERE
time_column >= start_date
AND time_column < end_date