-- Query: Active subscriptions by type
-- Result variable: active_subscriptions

SELECT
    pricing_plan_name,
    COUNT(*) AS subscription_count,
    COUNT(DISTINCT host_id) AS unique_hosts
FROM hostagentspg.public.subscriptions
WHERE status = 'active'
GROUP BY pricing_plan_name
ORDER BY subscription_count DESC