How do you write queries to extract, join, and validate data at Best Buy?
Use the provided Best Buy order, order-item, and product data. Return completed orders and classify each order line according to whether its product reference, quantity, prices, and calculated total are valid.
Output
- One row per order item from completed orders.
- Columns:
order_id, order_date, item_id, product_sku, product_name, quantity, recorded_unit_price, recorded_line_total, and validation_status.
- Include missing products and invalid lines, and order by
order_id, then item_id.