Write SQL and Python, run instantly in your browser, and track your progress.
You are a Customer Experience agent at LinkedIn. A user has reported a bug causing messages to occasionally not render correctly. To investigate, you need to pull a list of all direct messages sent on or after August 1st, 2025, that have not been deleted by the user.
Your task is to query the messages table to get a list of all messages that meet these criteria. The list should include the message ID, sender ID, recipient ID, the time it was sent, and its current status.
To make it easier to find the most recent messages related to the bug report, the list should be sorted with the newest messages first.
| Column Name | Type |
|---|---|
| message_id | INTEGER |
| sender_user_id |
You are a Customer Experience agent at LinkedIn. A user has reported a bug causing messages to occasionally not render correctly. To investigate, you need to pull a list of all direct messages sent on or after August 1st, 2025, that have not been deleted by the user.
Your task is to query the messages table to get a list of all messages that meet these criteria. The list should include the message ID, sender ID, recipient ID, the time it was sent, and its current status.
To make it easier to find the most recent messages related to the bug report, the list should be sorted with the newest messages first.
| Column Name | Type |
|---|---|
| message_id | INTEGER |
| sender_user_id |
| INTEGER |
| INTEGER |
| recipient_user_id | INTEGER |
| recipient_user_id | INTEGER |
| sent_at | TEXT |
| sent_at | TEXT |
| content_text | TEXT |
| content_text | TEXT |
| status | TEXT |
| status | TEXT |
| message_id | sender_user_id | recipient_user_id | sent_at | content_text | status |
|---|---|---|---|---|---|
| 1 | 1 | 33 | 2025-04-18 02:49:41 | Hi! I'm working on something similar. Would love to chat! | delivered |
| 2 | 1 | 4 |
| message_id | sender_user_id | recipient_user_id | sent_at | content_text | status |
|---|---|---|---|---|---|
| 1 | 1 | 33 | 2025-04-18 02:49:41 | Hi! I'm working on something similar. Would love to chat! | delivered |
| 2 | 1 | 4 |
| message_id | sender_user_id | recipient_user_id | sent_at | status |
|---|---|---|---|---|
| 318 | 57 | 26 | 2025-08-31 15:13:30 | sent |
| 324 | 58 | 13 | 2025-08-31 14:27:41 | read |
| 19 | 4 | 9 | 2025-08-31 14:08:02 | read |
| message_id | sender_user_id | recipient_user_id | sent_at | status |
|---|---|---|---|---|
| 318 | 57 | 26 | 2025-08-31 15:13:30 | sent |
| 324 | 58 | 13 | 2025-08-31 14:27:41 | read |
| 19 | 4 | 9 | 2025-08-31 14:08:02 | read |
Showing first 5 of 65 rows. Recent non-deleted messages from August 2025 onwards.
Showing first 5 of 65 rows. Recent non-deleted messages from August 2025 onwards.
Your final output should be a result set that meets the following requirements:
1. Filtering:
status is NOT 'deleted'.content_text is NULL (empty messages).2. Columns:
message_idsender_user_idrecipient_user_idYour final output should be a result set that meets the following requirements:
1. Filtering:
status is NOT 'deleted'.content_text is NULL (empty messages).2. Columns:
message_idsender_user_idrecipient_user_id| 2025-04-10 02:40:32 |
| 2025-04-10 02:40:32 |
| Thanks for sharing that resource! Super helpful. |
| Thanks for sharing that resource! Super helpful. |
| delivered |
| delivered |
| 3 | 2 | 58 | 2025-07-04 22:32:15 | Quick question - what tools do you use for productivity? | read |
| 3 | 2 | 58 | 2025-07-04 22:32:15 | Quick question - what tools do you use for productivity? | read |
| 4 | 2 | 5 | 2025-04-24 01:06:27 | Hi there! Fellow Developer here. Love your work! | read |
| 4 | 2 | 5 | 2025-04-24 01:06:27 | Hi there! Fellow Developer here. Love your work! | read |
| 5 | 2 | 50 | 2025-08-22 06:30:27 | Hey! Saw your post about productivity. Really resonated with me. | delivered |
| 5 | 2 | 50 | 2025-08-22 06:30:27 | Hey! Saw your post about productivity. Really resonated with me. | delivered |
| 328 | 58 | 45 | 2025-08-31 02:04:08 | read |
| 328 | 58 | 45 | 2025-08-31 02:04:08 | read |
| 291 | 53 | 30 | 2025-08-30 14:49:31 | read |
| 291 | 53 | 30 | 2025-08-30 14:49:31 | read |
sent_atsent_atstatusstatus3. Ordering:
3. Ordering:
sent_at in descending order (newest first).message_id in ascending order.sent_at in descending order (newest first).message_id in ascending order.