SELECT
6DISTINCT
7<select_list>
FROM
1 <left_table> <join_type> JOIN
<right_table> ON
<join_condition>
WHERE
2 <where_condition>
GROUP BY
3 <group_by_list>
WITH
4 {CUBE|ROLLUP}
HAVING
5 <having_condtion>
ORDER BY
8 <order_by_list>
LIMIT
9 <limit_number>