Optimizing Stock of Prime and Non-Prime Items in a Warehouse
 

Given a warehouse with a capacity of 500,000 square feet, Amazon wishes to optimize the number of items stocked, prioritizing prime items. The goal is to fill the warehouse with as many prime items as possible and then supplement the remaining space with non-prime items. However, there are new operational constraints: prime and non-prime items must be stocked in equal quantities, and there must always be non-prime items in stock. Assuming each item occupies the same amount of space, using the table playground.inventory, write a query to determine the maximum number of prime and non-prime items that can be accommodated in the warehouse. The output should list the item_type (prime_eligible or not_prime) followed by the maximum number of item_count that can be stocked, ensuring item counts are whole numbers and adhering to the given constraints and prime_eligible first.

These are the tables to query for this question:
playground.inventory
  • item_id int
  • item_type string
  • item_category string
  • square_footage double
Your answer should include these columns:
  • item_type varchar
  • item_count integer

Querying is only for logged in users!

Write Your Query Here (you can run selections by highlighting!)

Query Results

No queries have been run yet.