RienSQL
TASK #238 · Medium · Wallapop

Repeat 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.
Expected columnscity sellers repeat_sellers repeat_share_pctWallapop
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
usersuser_id, user_name, city, signup_date
listingslisting_id, seller_id, title, category, price, published_date, sold_date, buyer_id
chatschat_id, listing_id, buyer_id, started_date