RienSQL
TASK #240 · Medium · Wallapop

Chat-to-Sale Conversion

Your brief
Before buying, Wallapop users message the seller: each row in chats is a conversation of buyer buyer_id about listing listing_id. A chat converted into a sale if the listing was sold to exactly that buyer (listings.buyer_id equals chats.buyer_id).

Write a query that for each listing category returns category, the number of chats chats, the number of chats that converted into a sale converted_chats, and their percentage of all chats in the category conversion_pct, rounded to two decimals.
Expected columnscategory chats converted_chats conversion_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