SQL Practice Logo

SQLPractice Online

Level 5 - SeniorQuery-Based Questions

Materialized View for Monthly KPIs

Interviewer prompt: Finance needs fast month-level paid revenue and order count. Write PostgreSQL SQL to create and index a materialized view.

Schema Context

orders(order_id, order_ts, status, total_amount)