...

/

Anatomy of an SQL query

Anatomy of an SQL query

Get a brief introduction to basic clauses in SQL.

We'll cover the following...

Common clauses

These are the common clauses of an SQL query:

SELECT <expressions>
FROM <tables>
JOIN <to other table> ON <join condition>
WHERE <predicates>
GROUP BY <expressions>
HAVING <predicate>
ORDER BY <expressions>
LIMIT <number of rows>

Here is a quick overview of each clause:

SELECT: It lists the columns and expressions to appear in the query result output. ...