Snapchat wants to identify the most frequently shared Lenses in each user region during the most recent completed seven-day reporting period. Write a SQL query to calculate Lens share counts by region and return the top three Lenses for every region.
region, lens_id, lens_name, and share_count.share_count, with ascending lens_id as the deterministic tie-breaker.region, descending share_count, and ascending lens_id.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Snapchat user identifier |
| region | VARCHAR(50) | Geographic region associated with the user |
| Column | Type | Description |
|---|---|---|
| lens_idPK | INT | Unique Snapchat Lens identifier |
| lens_name | VARCHAR(100) | Display name of the Lens |
| Column | Type | Description |
|---|---|---|
| share_idPK | INT | Unique Lens share event identifier |
| user_id | INT | User who shared the Lens |
| lens_id | INT | Lens that was shared |
| shared_at | DATE | Date on which the Lens was shared |