Write a SQL query to identify the most frequent transaction category per user.
Use the provided users and transactions data. Exclude transactions without a category and users with no qualifying transactions. If a user has multiple categories tied for the highest frequency, return the alphabetically first category.
user_id, user_name, category, and transaction_countuser_id ascending| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User's display name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| category | VARCHAR(50) | Transaction category |