ab-logo

Code. Models. Analysis. Decisions.


Introduction to Queries with MySQL & Workbench

Querying Single Tables

Most work in SQL for the typical user probably consists of writing SQL, and pretty much any SQl that ends with a semi-colon can be considered a query. However we usually mean some fomr of subsetting, filtering and grouping when we use the term "query". SQL is an expressive language that allows users to result sets that meet whatever criteria they can express.

This tutorial walks through introductory SQL to filter and subset data covering sorting, meeting simple and compound criteria and limiting results sets.

Query Clause Order

SELECT
FROM
JOIN
WHERE
GROUP BY
HAVING
ORDER BY
LIMIT

You may also be interested in:

Creating Databases and Loading Data

INNER and OUTER JOINS

Using MySQL Text Functions

Statistics with MySQL

IF, CASE WHEN THEN


Download the data and code