Twitter analytics team needs to display the Trending Now section on the user dashboard. A hashtag is considered trending based on how many times it has been used in tweets within a rolling 6-hour window.
Write an SQL query to find the top 3 hashtags used in the last 6 hours.
| tweet_id(INTEGER) | user_id(INTEGER) | tweet_timestamp(TIMESTAMP) |
|---|---|---|
| 1 | 10 | 2026-02-10 08:00:00 |
| 2 | 11 | 2026-02-10 09:30:00 |
| 3 | 12 | 2026-02-10 10:15:00 |
| 4 | 13 | 2026-02-10 12:00:00 |
| 5 | 14 | 2026-02-10 13:45:00 |
| 6 | 15 | 2026-02-10 13:55:00 |
| hashtag_id(INTEGER) | hashtag_name(VARCHAR) |
|---|---|
| 1 | #SQL |
| 2 | #Tech |
| 3 | |
| 4 | #Data |
| tweet_id(INTEGER) | hashtag_id(INTEGER) |
|---|---|
| 1 | 1 |
| 2 | 1 |
| 3 | 2 |
| 4 | 1 |
| 5 | 2 |
| 6 | 3 |
| hashtag_name(VARCHAR) | usage_count(INTEGER) |
|---|---|
| #SQL | 3 |
| #Tech | 2 |
| 1 |