Module 04 of 12

SQL Fundamentals

Lessons

About This Module

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.

Lessons

5 videos
01

SQL Basics in 15 Minutes

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.

02

The Basic SELECT Statement

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.

03

Group Functions, GROUP BY and HAVING

Summarising data with SUM, AVG, COUNT, MIN, and MAX, combining them with WHERE, producing subtotals with GROUP BY, and filtering groups with HAVING.

04

SQL Joins

Combining data from multiple tables through a common key, writing joins with WHERE or the JOIN keyword, and avoiding accidental Cartesian products.

05

Outer Joins

How inner joins differ from LEFT and RIGHT OUTER JOINs, and how outer joins keep rows that have no match in the other table.