Back to problems

Merge ad CSVs and compute CTR

SQL · Capital One · Hard

Four CSV exports have been staged as four tables. Working in PostgreSQL and using SQL alone (no PL/pgSQL, no stored procedures, no client-side scripting), clean the data, join the tables without inflating row counts, aggregate over a fixed date range, and emit one combined result set. Available tables platforms(platform_id INT, platform VARCHAR(20)) ads(ad_id INT, platform_id INT, video_id INT) videos(video_id INT, title VARCHAR(100), duration_sec INT) totals(row_id INT,…

Checking your access…