'How To Select Cheapest Prices

Hello everyone I can't figure this out. I have a mysql statement which includes INNER JOIN for two tables. I need to get 1000 cheapest prices ordered by minimum to maximum. I have looked up on the internet but I can't seem to find the correct statement. The query is a prepared statement and I've changed the ? values in order to make it more readable. It works perfectly fine to get 1000 values from both table where conditions are true.The Code is below:

SELECT teachers.fname, 
       LEFT(teachers.lname, 1) AS lname, 
       profile.img_url, 
       profile.gender, 
       profile.title, 
       profile.introduction, 
       profile.city, 
       profile.preference, 
       profile.price,
       profile.keyword 
FROM profile 
INNER JOIN teachers ON profile.user_id = teachers.id 
WHERE profile.keyword LIKE 'mathematics' 
AND profile.gender = 'm' 
AND profile.price >= 0 
AND  profile.price <= 300  
LIMIT 1000


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source