Ollivander's Inventory

  • + 1 comment

    I think it's getting the minimum number of coins for each wand of a certain age and power (from the table outside the subquery). For every wand in Wands there is an age and a power, we just want the id of the wand that costs the minimum coins for an age power combination. So the subquery allows us to return just the rows where the coins_needed are equal to the minimum coins_needed for a set of age and power.