Complete the code to create a materialized view named 'sales_summary'.
CREATE MATERIALIZED VIEW sales_summary AS SELECT [1] FROM sales;The * selects all columns from the sales table to create the materialized view.
Complete the code to refresh the materialized view 'sales_summary'.
REFRESH MATERIALIZED VIEW [1];You refresh the materialized view by its exact name, which is sales_summary.
Fix the error in the code to create a materialized view with a unique index.
CREATE MATERIALIZED VIEW sales_summary AS SELECT customer_id, SUM(amount) AS total FROM sales GROUP BY [1];total which is invalid.amount or sales_id.The GROUP BY clause must include the column customer_id because it is selected and aggregated by SUM(amount).
Fill both blanks to create a unique index on the materialized view 'sales_summary'.
CREATE UNIQUE INDEX [1] ON sales_summary([2]);
total for the unique index.The unique index is named sales_summary_idx and is created on the customer_id column to ensure uniqueness.
Fill all three blanks to create and refresh a materialized view with data.
CREATE MATERIALIZED VIEW [1] AS SELECT [2] FROM sales WHERE amount [3] 100;
< instead of > changes the filter logic.The materialized view high_value_sales selects all columns * from sales where amount is greater than 100.