Create a view named product_summary. This view should return summary information about each product. Each row should include pro
duct_id, order_count (the number of times the product has been ordered) and order_total (the total sales for the product).Write a SELECT statementthat returns all the columns from the product_summaryview.
SELECT product_id , order_count , order_total FROM Product;
SELECT * FROM [product_summary] ;
Explanation:
First of all, use the CREATE VIEW syntax to create a view named product_summary that includes the product_id, order_count, order_total columns and returns the summary information about each product.
Use SELECT statement to return all the columns from the product_summary view.
Programming is a set of instructions i.e. Input given by the user to the computer to perform a particular task and give the desired result i.e. output.