
At Autodesk, the support team wants to find customers who generated a high number of support tickets in May 2024 but did not log into Autodesk Fusion during that same month.
Write a SQL query to return customers who meet these conditions.
NULL.ticket_count_past_month descending, then last_login_at ascending with NULLS FIRST.customers| column | type | description |
|---|---|---|
| customer_id | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer full name |
| account_status | VARCHAR(30) | Current account status |
support_tickets| column | type | description |
|---|---|---|
| ticket_id | INT | Unique support ticket identifier |
| customer_id | INT | Customer who submitted the ticket |
| product_name | VARCHAR(100) | Product tied to the ticket |
| submitted_at | TIMESTAMP | Ticket submission time |
| issue_type | VARCHAR(50) | Support issue category |
login_events| column | type | description |
|---|---|---|
| login_id | INT | Unique login event identifier |
| customer_id | INT | Customer who logged in |
| product_name | VARCHAR(100) | Product used during login |
| login_at | TIMESTAMP | Login timestamp |
| device_type | VARCHAR(30) | Device used |
| customer_id | customer_name | ticket_count_past_month | last_login_at |
|---|---|---|---|
| 106 | Farah Khan | 4 | NULL |
| 103 | Carla Gomez | 4 | 2024-04-20 17:45:00 |
| 101 | Amina Patel | 4 | 2024-04-28 09:00:00 |
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer full name |
| account_status | VARCHAR(30) | Current account status |
| Column | Type | Description |
|---|---|---|
| ticket_idPK | INT | Unique support ticket identifier |
| customer_id | INT | Customer who submitted the ticket |
| product_name | VARCHAR(100) | Product associated with the ticket |
| submitted_at | TIMESTAMP | Ticket submission timestamp |
| issue_type | VARCHAR(50) | Support issue category |
| Column | Type | Description |
|---|---|---|
| login_idPK | INT | Unique login event identifier |
| customer_id | INT | Customer who logged in |
| product_name | VARCHAR(100) | Product used during login |
| login_at | TIMESTAMP | Login timestamp |
| device_type | VARCHAR(30) | Device used for login |
| customer_id | customer_name | account_status |
|---|---|---|
| 106 | Farah Khan | active |
| 101 | Amina Patel | active |
| 108 | Hugo Martin | active |
| 103 | Carla Gomez | suspended |
| 105 | Ethan Wright | active |
| 102 | Brian Lee | active |
| 109 | Ivy Chen | |
| 104 | Deepa Nair | trial |
| 107 | Grace Liu | cancelled |
| 110 | Jonas Weber | active |
| 111 | Wendy Zhao | verification_pending |
| 112 | Samuel Ortiz | enterprise |
| 1 | Emma Foster | cancelled |
| 2 | Ethan Wright | enterprise |
| 3 | Marcus Reed | active |
| 4 | Jonas Weber | sandbox |
| 5 | Ethan Wright | suspended |
| 6 | Samuel Ortiz | expired |
| 7 | Lucas Romero | pending_review |
| 8 | Mei Lin | trial |
| 9 | Amina Patel | null |
| 10 | Jonas Weber | renewed |
| 11 | Noah Bennett | pending_review |
| 12 | Arjun Mehta | verification_pending |
| 13 | Amina Patel | prospect |
| 14 | Wendy Zhao | prospect |
| 15 | Hugo Martin | guest |
| 16 | Marcus Reed | migrated |
| login_id | customer_id | product_name | login_at | device_type |
|---|---|---|---|---|
| 3008 | 106 | AutoCAD | 2024-05-11 10:00:00 | desktop |
| 3001 | 101 | Autodesk Fusion | 2024-04-28 09:00:00 | desktop |
| 3010 | 108 | Autodesk Fusion | 2024-05-18 07:30:00 | desktop |
| 3003 | 102 | Autodesk Fusion | 2024-05-12 08:00:00 | desktop |
| 3012 | 109 | 2024-05-07 08:15:00 | desktop | |
| 3005 | 103 | Autodesk Fusion | 2024-04-20 17:45:00 | web |
| 3007 | 105 | Autodesk Fusion | 2024-05-02 06:50:00 | mobile |
| 3013 | Autodesk Fusion | 2024-05-09 13:00:00 | web | |
| 3002 | 101 | Autodesk Inventor | 2024-05-15 10:10:00 | web |
| 3011 | 108 | Autodesk Fusion | 2024-04-30 23:59:00 | mobile |
| 3004 | 102 | Autodesk Fusion | 2024-04-25 18:30:00 | mobile |
| 3006 | 104 | Autodesk Fusion | 2024-05-30 19:20:00 | desktop |
| 1 | 7 | Build | 2024-05-13 08:51:16 | ipad |
| 2 | 72 | AutoCAD | 2024-04-21 23:50:54 | desktop |
| 3 | 28 | Vehicle Tracking | 2024-05-07 03:10:17 | windows |
| 4 | 77 | Maya | 2024-05-18 10:02:40 | unknown |
| 5 | 76 | MotionBuilder | 2024-05-08 17:10:56 | browser |
| 6 | 92 | Civil 3D | 2024-05-04 18:24:42 | null |
| 7 | 22 | Fusion Manage | 2024-04-29 16:43:10 | null |
| 8 | 61 | Fusion Manage | 2024-05-23 23:57:17 | vm |
| 9 | 23 | Autodesk Fusion | 2024-04-19 11:50:30 | workstation |
| 10 | 3 | Autodesk Inventor | 2024-05-10 02:02:29 | android |
| 11 | 31 | Civil 3D | 2024-05-13 16:52:57 | browser |
| 12 | 11 | Navisworks | 2024-05-26 08:16:01 | webview |
| 13 | 8 | AutoCAD | 2024-06-02 16:33:27 | vm |
| ticket_id | customer_id | product_name | submitted_at | issue_type |
|---|---|---|---|---|
| 2009 | 103 | Autodesk Fusion | 2024-05-14 08:15:00 | performance |
| 2001 | 101 | Autodesk Fusion | 2024-05-03 09:15:00 | login_issue |
| 2015 | 105 | AutoCAD | 2024-05-07 13:00:00 | billing |
| 2018 | 106 | Autodesk Fusion | 2024-05-09 12:00:00 | crash |
| 2024 | 108 | Autodesk Fusion | 2024-05-16 09:30:00 | performance |
| 2010 | 103 | Autodesk Fusion | 2024-05-20 10:45:00 | billing |
| 2021 | 106 | Autodesk Fusion | 2024-05-25 16:40:00 | billing |
| 2004 | 101 | Autodesk Fusion | 2024-05-28 16:20:00 | sync |
| 2026 | 109 | Autodesk Fusion | 2024-05-05 10:10:00 | login_issue |
| 2012 | 104 | Autodesk Fusion | 2024-05-08 09:10:00 | crash |
| 2006 | 102 | Autodesk Fusion | 2024-05-05 12:00:00 | crash |
| 2020 | 106 | Autodesk Fusion | 2024-05-18 14:25:00 | login_issue |
| 2027 | 109 | Autodesk Fusion | 2024-05-18 11:10:00 | billing |
| 2002 | 101 | Autodesk Fusion | 2024-05-10 14:30:00 | crash |
| 2011 | 103 | Autodesk Fusion | 2024-05-29 18:00:00 | sync |
| 2014 | 104 | Autodesk Fusion | 2024-05-30 17:20:00 | performance |
| 2028 | 110 | Autodesk Fusion | 2024-05-31 23:59:00 | sync |
| 2019 | 106 | Autodesk Fusion | 2024-05-12 08:45:00 | performance |
| 2007 | 102 | Autodesk Fusion | 2024-05-19 15:00:00 | billing |
| 2023 | 107 | Autodesk Fusion | 2024-05-22 10:05:00 | billing |
| 2008 | 103 | Autodesk Fusion | 2024-05-02 07:30:00 | login_issue |
| 2016 | 105 | Autodesk Fusion | 2024-04-29 09:00:00 | crash |
| 2005 | 102 | Autodesk Fusion | 2024-04-27 10:00:00 | login_issue |
| 2025 | 108 | Autodesk Fusion | 2024-05-27 15:45:00 | billing |
| 2022 | 107 | Autodesk Fusion | 2024-05-03 11:00:00 | crash |
| 2017 | Autodesk Fusion | 2024-05-11 10:30:00 | other | |
| 2013 | 104 | Autodesk Fusion | 2024-05-21 12:40:00 | login_issue |
| 2003 | 101 | Autodesk Fusion | 2024-05-18 11:00:00 | billing |
| customer_id | customer_name | ticket_count_past_month | last_login_at |
|---|---|---|---|
| 106 | Farah Khan | 4 | |
| 103 | Carla Gomez | 4 | 2024-04-20 17:45:00 |
| 101 | Amina Patel | 4 | 2024-04-28 09:00:00 |