SQL syntax order

When writing a query, how do you know the order of it?
Ex: If you need to write a query on the number of applications at each price that have been downloaded over 20,000 times, the exercise showed the query as Select price, count (*) from fake_apps where downloads > 20,000;

Why would the word price come before count in the query?

But in another example where the query had to be written on naming the most downloaded applications in each category, the query was Select name, category, MAX (downloads) from fake_apps, group by category;

Why would the word name come before category in this case?

It is the order the columns are written in the summary table.

But in the first one it says “number of applications” before price so wouldn’t that be a reason for the word count to be listed first?

Column order is arbitrary. It’s what the author chose.

I understand that what you’re grouping by comes before what is being found but in this case: name the most downloaded applications in each category, the syntax shown is SELECT name, category, MAX (downloads) from fake_apps, group by category;
Why isn’t the word category before the word name in the syntax?

See my previous post. It’s just what the author chose.