230k views
3 votes
Create a view named product_summary. This view should return summary information about each product. Each row should include product_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.

1 Answer

2 votes

Answer:

CREATE VIEW [product_summary] AS

SELECT product_id , order_count , order_total FROM Product;

SELECT * FROM [product_summary] ;

Step-by-step 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.
User Smit Gajera
by
6.9k points