Level 5 - SeniorQuery-Based Questions
Design Orders Table for Production
Interviewer prompt: Design a production-ready orders table for an ecommerce system. Your task: 1) Create table orders with order_id, customer_id, order_ts, status, total_amount, currency_code 2) Enforce primary key, foreign key, status check, positive amount check 3) Add indexes for customer timeline lookups and status dashboards.
Schema Context
customers(customer_id)