Answer:
Following are the Query to this question:
/*creating view product_summary */
CREATE VIEW product_summary AS
SELECT product_name, COUNT (order id) As order_count,
/* selects columns names */
SUM(item_total) AS order_total /* add values */
FROM order_item_products /* table name order_item_products*/
GROUP BY product name;
Step-by-step explanation:
Creating view description can be described as follows:
- In view creation "CREATE VIEW' command is used, which creates its view "product_summary".
- In this creation, the columns are used, which returns the view that will come from the "SELECT" command.
- In this "FROM" command is uses the table, in which all "order_count" and "order_total" manipulate columns, use the "AS" command is used, which gives all the existing values, and it also uses the group by, which operates each product.