Quick Answer
ORDER BY sorts query results. ASC (ascending, default) or DESC (descending). Sort by multiple columns: ORDER BY last_name ASC, first_name ASC. Without ORDER BY, MySQL makes no guarantee about row order - never assume rows come back in insert order. ORDER BY can sort by column position (ORDER BY 2) but this is fragile. Always use column names for clarity.
Answer
ORDER BY sorts query results in ascending or descending order on one or more columns.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.