The ORDER BY keyword is used to sort the result-set by one or more columns.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in a descending order, we can use the DESC keyword.
Here is one example :
SELECT column_name,column_name
FROM table_name
ORDER BY column_name,column_name ASC|DESC;
The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns.
Here is one example :
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name;
We can also use the GROUP BY statement on more than one column.