Back to problems

Merge seven tables into one clean DataFrame

Algorithm · Capital One · Medium

An e-commerce dataset is split across seven normalized tables: customers, orders, order_items, products, payments, shipments, and refunds. Your task is to flatten these tables into a single denormalized fact table that has exactly these columns, in this order: order_item_id, order_id, customer_id, order_ts, paid_ts, shipped_ts, product_id, sku, category, qty, unit_price, line_amount, refund_amount, country, status, payment_method, carrier Each output row must correspond to…

Checking your access…