We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Ollivander's Inventory
You are viewing a single comment's thread. Return to all comments →
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.