Question: write a statement to create a view called product _ sales _ totals which will group sales data by product and year. Columns should include

write a statement to create a view called product_sales_totals which will group sales data by product and year. Columns should include product_id, year, product_sales, and gear_sales. The gear_salescolumn will contain the total sales for the "Gear-Large" or the total sales for "Gear - Small" products, depending on the product_id. In the case that the product is neither "Gear-Large" or "Gear-Small", the value for gear_sales should be 0.(The data should be generated by an expression, and it is ok to use the product_id values in the expression). To accomplish this, you need a case statement. The product_sales column should be a sum of sales for the particular product_id and year, regardless of what kind of product it is (including gears).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!