TASK #238 · Medium · WallapopRepeat Sellers by City
Your brief
A listing in listings is sold if its sold_date is not NULL. The city of
the seller seller_id is stored in users.city.
Write a query that for each city returns city, the number of sellers with at least one sale sellers, the number of repeat sellers with two or more sales repeat_sellers, and repeat_share_pct: the percentage of repeat_sellers out of sellers, rounded to two decimals. Cities without sales must not appear in the result.
Write a query that for each city returns city, the number of sellers with at least one sale sellers, the number of repeat sellers with two or more sales repeat_sellers, and repeat_share_pct: the percentage of repeat_sellers out of sellers, rounded to two decimals. Cities without sales must not appear in the result.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
usersuser_id, user_name, city, signup_datelistingslisting_id, seller_id, title, category, price, published_date, sold_date, buyer_idchatschat_id, listing_id, buyer_id, started_date