Most business data lives in relational databases, and SQL is the language you use to ask questions of it. This module starts with the basics: what a relational database is, how a query works, and how to pull exactly the columns and rows you need with SELECT, WHERE, and ORDER BY.
You'll then learn to summarise data with group functions such as SUM, AVG, and COUNT, together with GROUP BY and HAVING. The module finishes with joins, so you can combine data from several tables using inner joins and keep unmatched rows with left and right outer joins.
Once you can write these queries, you'll be ready for the next module, Advanced SQL, where you go beyond the basics.
A fast walkthrough of relational databases and queries, then SELECT, FROM, WHERE, ORDER BY, GROUP BY, HAVING, LIMIT, COUNT, DISTINCT, and a first LEFT JOIN, using MySQL Workbench.
How a SQL query takes tables as input and returns another table, and how to choose the columns you want to see with the basic SELECT statement.
Summarising data with SUM, AVG, COUNT, MIN, and MAX, combining them with WHERE, producing subtotals with GROUP BY, and filtering groups with HAVING.
Combining data from multiple tables through a common key, writing joins with WHERE or the JOIN keyword, and avoiding accidental Cartesian products.
How inner joins differ from LEFT and RIGHT OUTER JOINs, and how outer joins keep rows that have no match in the other table.