Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions