Write a SQL query to find all users who have active subscriptions but have not logged into the app in the last 30 days at Truebill.
Use the provided users, subscriptions, and app_logins tables. Treat subscriptions with status active and no past end date as active.
user_id, email, and last_login_at.user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Truebill user identifier |
| VARCHAR(255) | User email address |
| Column | Type | Description |
|---|---|---|
| subscription_idPK | INT | Unique subscription identifier |
| user_id | INT | User who owns the subscription |
| status | VARCHAR(20) | Current subscription status |
| end_date | DATE | Subscription end date, or NULL for an open-ended subscription |
| Column | Type | Description |
|---|---|---|
| login_idPK | INT | Unique login event identifier |
| user_id | INT | User who logged into the app |
| login_at | TIMESTAMP | Timestamp of the login event |