How would you write a query to find the top 3 most used features per customer account using window functions?
Use the account, feature, and feature usage tables. Return only accounts with at least one matched feature usage record. Break usage-count ties alphabetically by feature name.
account_id, account_name, feature_name, usage_count, feature_rankaccount_id, feature_rank, and feature_name| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique customer account identifier |
| account_name | VARCHAR(120) | Customer account name |
| Column | Type | Description |
|---|---|---|
| feature_idPK | INT | Unique feature identifier |
| feature_name | VARCHAR(120) | Rippling product feature name |
| Column | Type | Description |
|---|---|---|
| usage_idPK | INT | Unique feature usage event identifier |
| account_id | INT | Customer account associated with the event |
| feature_id | INT | Feature associated with the event |