AdMetrics Agency manages digital advertising campaigns across multiple channels
AdMetrics Agency manages digital advertising campaigns across multiple channels. They need to identify campaigns that show declining performance by analyzing impression volume trends. A campaign is considered 'declining' if it has at least 3 consecutive days where daily impressions are lower than the previous day. For each declining campaign, return the campaign_id, campaign_name, advertiser_name, and the start_date of the first declining streak (the first day in the longest sequence of consecutive declines). If multiple streaks exist of the same length, return the earliest start_date. Order results by start_date, then by campaign_id.
Example 1
Example 2
- ›Return campaigns with at least 3 consecutive declining days
- ›Show the start_date of the first (earliest) declining streak if multiple exist
- ›Order by start_date, then campaign_id
- ›Handle cases where campaigns have mixed patterns
Reference solution available after you attempt the question.
Ready to solve it?
Start a session on Mockbit #55. Write your SQL, run it against real data, and get graded on correctness, efficiency, query structure, and business understanding.
- #46A streaming platform wants to identify content that's experiencing 'viewership...medium
- #56TelecomCorp wants to analyze call quality degradation patterns across their cell...medium
- #57A hedge fund tracks daily portfolio performance across multiple trading...medium
- #41You're analyzing user engagement for a social media platformeasy
- #42A video streaming platform tracks user viewing sessionshard