Question: SQL Coding Question: THIS IS THE REQUIREMENT FOR THE CODE: note that total sales and total gross product are NOT a column in the original
SQL Coding Question:
THIS IS THE REQUIREMENT FOR THE CODE: note that total sales and total gross product are NOT a column in the original table.
QUERY: For each vendor return the total sales (calculated as: move * price / qty) of their products at each store between the years 1992 and 1995 (inclusive). Sort by total sales descending. The output should have the vendorid, store number, and total sales (renamed as totalSales).
QUERY: For each store and product, return the totalSales, total gross profit (totalGP = price*move/qty*profit/100), count of weekly sales records, and average move amount of the product at that store. Only show data for vendors with a name > 'H'. Sort by gross profit descending. The output should have the store number, product UPC, total sales, total gross profit, count of records, and average move volume (renamed averageMove).
THESE ARE THE COLUMN TITLES IN THE TABLE CALLED 'SALES':
- store, upc, week, move, qty, price, sale, profit, ok, year, vendorid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
