Complete the code to create a simple view named employee_view that selects all columns from the employees table.
CREATE VIEW employee_view AS SELECT * FROM [1];The view employee_view should select from the employees table to show employee data.
Complete the code to create a materialized view named sales_summary that sums the amount column from the sales table.
CREATE MATERIALIZED VIEW sales_summary AS SELECT SUM([1]) AS total_amount FROM sales;The materialized view sums the amount column to get total sales.
Fix the error in the code to create a view named dept_view that selects department_id and department_name from the departments table.
CREATE VIEW dept_view AS SELECT department_id, [1] FROM departments;The correct column name is department_name to match the table schema.
Fill both blanks to create a materialized view named active_customers that selects customer_id and customer_name from customers where status is 'active'.
CREATE MATERIALIZED VIEW active_customers AS SELECT [1], [2] FROM customers WHERE status = 'active';
The materialized view selects customer_id and customer_name to show active customers.
Fill all three blanks to create a view named order_details_view that selects order_id, product_id, and quantity from the order_details table where quantity is greater than 10.
CREATE VIEW order_details_view AS SELECT [1], [2], [3] FROM order_details WHERE quantity > 10;
The view selects order_id, product_id, and quantity to show orders with quantity over 10.