• This looks me as a homework job, so the OP has to find the solution, that's why I didn't give the query,

    Just a hint: Min quantity = 1, max = 1000 / Price.. + a tally table.