Write a SQL query to combine daily sales, inventory, and staffing tables to identify Victoria's Secret stores where sales are down but inventory is high.
Use the latest date represented in the daily sales data. Sales are down when total sales are lower than the store's previous day, and inventory is high when it is at least the average inventory across stores on that date.
Output
- One row per qualifying store with
store_id, current sales, previous-day sales, decline percentage, inventory units, average inventory units, and staff count
- Include only stores meeting both conditions, ordered by greatest decline percentage, then
store_id