Allocating forecast to deeper granularity in SQL
You're given the following tables, called 'sales_forecast' and 'current_inventory'. The 'sales_forecast' table shows projected sales volume (in terms of # of units) by location by year. The 'current_inventory' shows the current # of units available by location and by color. The tables are shown below:
Using these tables, write a SQL query to take the current sales forecast and allocate it down to a projection of colors that will be sold at each location. For the simplicity of this example, you can use the current_inventory table to map the projected color proportions by each location. (e.g. if Blue represents XX% of New York's current inventory you can use that percent to allocate New York's total sales forecast down to the color Blue, and so on).
Click here to view these tables in an interactive SQL fiddle.
Subscribe to premium account to see the solution.Get premium now