How do I remember the order of a SQL query when writing them? I know the basic order 1. SELECT, 2. FROM, 3. WHERE, but how do I know when to use other clauses when creating a query (i.e. ORDER BY, CAST, CONCAT_WS)? I understand that sometimes I may have to replace clauses, add a clause before the SELECT statement, or not even use the WHERE clause at all. How do I remember the order, when, and what to use when writing a query?