SQL practice: Materialized Views: Caching a Query
Chapter 44 · 5 questions · included in full access
Question 1 · easy
Solve it in your browserCreate a materialized view named branch_revenue holding branch_id, branch_name and total revenue (quantity times unit_price from order_items) for every branch that has orders.
Question 2 · easy
Solve it in your browserQuery the branch_revenue materialized view for branches with revenue above 400000. Show branch_name and revenue, ordered by revenue descending.
Question 3 · medium
Solve it in your browserCreate a unique index named branch_revenue_pk on branch_revenue over branch_id, so the view can later be refreshed concurrently.
Question 4 · hard
Solve it in your browserCreate a materialized view named product_sales holding product_id, product_name and total units sold, for products that have been sold at least once.
Question 5 · hard
Solve it in your browserWhich statement about materialized views is true?
These questions are part of full access.
The first chapters of every track are free. Full access is a one-time payment.
See pricing