This question evaluates data manipulation and analytical SQL competencies such as joining tables, aggregating and deduplicating interaction counts, applying date-window filters, and computing category-level percentage metrics.
You are given two tables:
listing_interactions
buyer_id
BIGINT
seller_id
BIGINT
event_date
DATE
product_id
BIGINT
listing_interactions
INT — number of buyer-seller interactions for that product on that date
dim_all_products
product_id
BIGINT
category
STRING
snapshot_date
DATE
create_date
DATE
country
STRING
Assumptions:
product_id
.
listing_interactions
summed across all rows for the same
(seller_id, product_id)
is greater than 1.
country = 'US'
and
create_date
in the last 7 calendar days, inclusive of
CURRENT_DATE
.
SUM(listing_interactions)
.
Write SQL for the following two tasks:
seller_count
vehicle
category?
vehicle_interaction_pct