How would you structure a SQL query to identify customers who have upgraded their subscription tiers but have not adopted key product features on HubSpot?
Assume an upgrade is a move to a higher tier, and feature adoption is evaluated after the customer's most recent upgrade. Key features are identified in the feature catalog.
Output
- One row per qualifying customer with
customer_id, customer_name, previous_tier, new_tier, upgrade_date, missing_key_feature_count, and missing_key_features.
- Include only customers whose most recent upgrade is followed by no adoption of any key feature.
- Order by
upgrade_date descending, then customer_id ascending.
Output details
- Rank tiers as
Starter < Professional < Enterprise when determining whether an event is an upgrade.
- Break subscription-event date ties by
event_id ascending for prior tiers and descending when selecting the most recent upgrade.
- Treat feature usage on the upgrade date as adoption by using an inclusive boundary.
- Order missing feature names alphabetically and separate them with
, in missing_key_features.
- Retain duplicate key-feature catalog rows without deduplication.