Your question is Top Pages By Unique Visitors. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Similarweb Digital Research needs a country-level view of the most visited pages. Write a PostgreSQL query that returns the top three pages by unique visitors for every country represented in the page-view data.
page_id.| Column | Type | Description |
|---|---|---|
| view_idPK | INTEGER | Unique page-view event identifier |
| page_id | INTEGER | Identifier of the viewed page |
| country_code | VARCHAR(2) | Two-letter visitor country code |
| visitor_id | VARCHAR(20) | Anonymized visitor identifier |
| Column | Type | Description |
|---|---|---|
| page_idPK | INTEGER | Unique page identifier |
| page_name | VARCHAR(100) | Page title from Similarweb metadata |