On Meta messaging surfaces, growth analysts often monitor who is driving recent conversation volume as part of engagement diagnostics alongside AARRR funnel metrics. Write a SQL query to find the top 3 users who sent the most messages in the last 7 days.
messages table.sender_user_id sent in the last 7 days.sender_user_id and message_count.message_count descending, then sender_user_id ascending.messages
| column | type | description |
|---|---|---|
| message_id | INT | Unique message identifier |
| sender_user_id | INT | User who sent the message |
| recipient_user_id | INT | User who received the message |
| sent_at | TIMESTAMP | Time the message was sent |
| message_surface | VARCHAR(50) | Meta surface where the message was sent |
| message_text | TEXT | Message body |
| message_id | sender_user_id | recipient_user_id | sent_at | message_surface | message_text |
|---|---|---|---|---|---|
| 8 | 104 | 201 | 2024-06-10 08:00:00 | Facebook Groups | Morning update |
| 1 | 101 | 201 | 2024-06-14 09:00:00 | Instagram Reels | Shared a reel |
| 2 | 101 | 202 | 2024-06-15 10:30:00 | Instagram Reels | Check this out |
| 3 | 102 | 203 | 2024-06-15 12:00:00 | Facebook Groups | Group reminder |
| 4 | 101 | 204 | 2024-06-16 08:15:00 | Instagram Reels | Another reel |
| 5 | 103 | 205 | 2024-06-16 13:45:00 | Facebook Groups | null |
| 6 | 102 | 206 | 2024-06-17 11:20:00 | Instagram Reels | Nice post |
| 7 | 102 | 207 | 2024-06-18 19:05:00 | Facebook Groups | Event tonight |
| 9 | 103 | 202 | 2024-06-19 14:10:00 | Instagram Reels | Saved this |
| 10 | 101 | 203 | 2024-06-20 09:40:00 | Facebook Groups | Follow-up |
| 11 | 105 | 208 | 2024-06-20 16:00:00 | Empty surface test | |
| 12 | 102 | 209 | 2024-06-21 18:30:00 | Instagram Reels | Final ping |
Assume current_date = '2024-06-21' for this question.
| sender_user_id | message_count |
|---|---|
| 101 | 4 |
| 102 | 4 |
| 103 | 2 |