Overview

Course Overview β€” SQL Joins & Advanced Group Filtering Practice | DataSosi
Course Designer
Professor Mark Lokanan
Royal Roads University
Academic Director  ·  Canadian Institute of Artificial Intelligence (CiAI)
Architect of Next-Generation AI and Machine Learning Systems for Fraud Detection and Financial Crime Analytics
Course Overview · SQL Practice Series · Part 5

SQL Joins & Advanced
Group Filtering Practice

Combining related business tables and filtering linked analytical results — the multi-table SQL skills that drive real-world analytics reporting.

In real-world analytics, business data is never stored in a single table. Customer records, transaction activity, orders, products, subscriptions, and support data each live in their own table. Across five parts, you will master JOINs, INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN — the tools that connect related tables and unlock multi-table business insights. Same tables as Parts 1–4. Every query includes an AI prompt and a validated SQL answer.
5 Parts
40 Practice Queries
Same Tables as Parts 1–4
AI-Assisted Learning
Certificate of Completion

Course Learning Objectives

  • Use JOIN…ON to combine two related tables using a shared key column, applying table.column notation for unambiguous column references.
  • Use INNER JOIN to retrieve only records that have matching values in both tables, excluding unmatched rows from either side.
  • Use LEFT JOIN to preserve all records from the left table including those with no match in the right table, returning NULL in right-table columns for unmatched rows.
  • Use RIGHT JOIN to preserve all records from the right table including those with no match in the left table, returning NULL in left-table columns for unmatched rows.
  • Simulate FULL JOIN in MySQL using LEFT JOIN UNION RIGHT JOIN to return all records from both tables — matched and unmatched — for complete relationship visibility.
Five parts — click any part to see its topics and practice focus.
Foundation

Part 1 introduces SQL JOINs — the mechanism that connects related tables in a relational database. Students learn the JOIN…ON structure, why table.column notation is required, how shared key columns link tables, and apply the pattern across users, transactions, orders, products, subscriptions, and sessions.

Topic 1
Combining Tables

The JOIN…ON structure and how it merges rows from two related tables using a shared column.

Topic 2
Relational Database Logic

Primary keys, foreign keys, and the key relationships in the course database.

Topic 3
Linking Business Data

Connecting users to transactions, products to order items, and users to subscriptions.

Topic 4
Multi-Table Analysis

Why JOIN is the most important SQL skill for professional analytical work.

  • Practice focus: joining users to transactions, orders, subscriptions, tickets, campaign events, and sessions; and joining products to order items
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Matching Records

Part 2 covers INNER JOIN — the join type that returns only rows with matching values in both tables. Students learn why INNER JOIN excludes unmatched rows, why it produces no NULL values from the join itself, and that it is identical to a plain JOIN in MySQL.

Topic 1
Matching Records

How INNER JOIN returns only the intersection — rows where both tables have a corresponding value.

Topic 2
Shared Business Relationships

Analyzing established relationships where both sides of the link must exist.

Topic 3
Linked Operational Data

Products with sales, users with orders, customers with subscriptions — all requiring both sides.

Topic 4
Customer Transaction Analysis

Joining user profiles to transaction amounts for financial reporting with no NULLs.

  • Practice focus: INNER JOIN across users-transactions, users-orders, products-order_items, users-subscriptions, users-tickets, users-campaign_events, and users-sessions
  • 8 practice queries — each with an AI prompt and a validated SQL answer
All Left Records

Part 3 covers LEFT JOIN — the join type that preserves all left-table rows. Students learn that unmatched left rows appear with NULL in right-table columns, how to use this for gap detection, and when to choose LEFT JOIN over INNER JOIN to preserve the complete left-table list.

Topic 1
Keeping All Left Records

Every left-table row appears regardless of whether a matching row exists in the right table.

Topic 2
Identifying Missing Matches

Rows with NULL in right-table columns reveal customers without orders, products without sales.

Topic 3
Incomplete Business Activity

Using LEFT JOIN to surface operational gaps — users without subscriptions, tickets without users.

Topic 4
Optional Relationships

LEFT JOIN when the right-side relationship may not always exist for every left-table record.

  • Practice focus: LEFT JOIN preserving all users, all products, and all orders alongside optional related data across the database
  • 8 practice queries — each with an AI prompt and a validated SQL answer including a multi-table chain join for orders → order_items → products
All Right Records

Part 4 covers RIGHT JOIN — the mirror of LEFT JOIN, preserving all right-table rows. Students learn how RIGHT JOIN surfaces orphaned records, how any RIGHT JOIN can be rewritten as a LEFT JOIN by swapping table order, and when to use RIGHT JOIN for completeness checks on operational records.

Topic 1
Keeping All Right Records

Every right-table row appears regardless of whether a matching row exists in the left table.

Topic 2
Reverse Relationship Analysis

Analyzing business relationships from the right-table perspective — all orders, all subscriptions.

Topic 3
Business Completeness Checks

Identifying orphaned right-table records with NULL in left-table columns after the join.

Topic 4
Linked Reporting

Preserving complete operational tables (transactions, order_items) as the primary reporting subject.

  • Practice focus: RIGHT JOIN preserving all transactions, orders, order_items, subscriptions, tickets, campaign_events, and sessions
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Complete Visibility

Part 5 covers FULL JOIN — the most inclusive join type. Students learn that MySQL does not support FULL JOIN natively, how to simulate it using LEFT JOIN UNION RIGHT JOIN, and how UNION removes duplicate rows to produce the full outer join result.

Topic 1
Combining All Records

FULL JOIN returns matched rows plus all unmatched rows from each table with NULLs.

Topic 2
Complete Relationship Visibility

All users, all orders, all subscriptions visible simultaneously — matched and unmatched.

Topic 3
Missing Match Analysis

Gaps on both sides visible at once — the complete reconciliation picture.

Topic 4
Full Business Coverage

Data quality audits and completeness reports requiring all records from both datasets.

  • Practice focus: simulating FULL JOIN using LEFT JOIN UNION RIGHT JOIN across all major table pairs in the database
  • 8 practice queries — each with an AI prompt and a validated SQL answer using the UNION pattern

Course at a Glance

Five parts · 40 practice queries · same tables as Parts 1–4

PartJOIN TypeWhat It ReturnsPractice
Part 1JOIN (Introduction)Introduces the JOIN…ON structure and table.column notation for multi-table queries8 Queries
Part 2INNER JOINOnly rows with matching values in both tables — no unmatched rows, no NULLs from the join8 Queries
Part 3LEFT JOINAll left-table rows plus matching right rows — unmatched left rows show NULL in right columns8 Queries
Part 4RIGHT JOINAll right-table rows plus matching left rows — unmatched right rows show NULL in left columns8 Queries
Part 5FULL JOIN (via UNION)All rows from both tables — matched pairs, left-only rows, and right-only rows8 Queries
AI-Assisted SQL Learning

Every practice question in this course includes a business question, an AI prompt for ChatGPT or Copilot, the validated SQL answer, and guidance on interpreting the result. Students learn to prompt effectively, validate JOIN logic, troubleshoot relationship errors, and connect multi-table output to real business decisions.

What You Leave With

Five JOIN types. Forty practice queries. A complete multi-table SQL toolkit.

JOIN Foundations

The JOIN…ON structure and table.column notation for any multi-table query.

INNER JOIN

Matched-record retrieval — the strictest join type for confirmed business relationships.

LEFT JOIN

Complete left-table lists alongside optional right-table data — including gap detection.

RIGHT JOIN

Complete right-table records for completeness checks and reverse relationship analysis.

FULL JOIN

Full outer join simulation via LEFT JOIN UNION RIGHT JOIN for complete visibility.

AI-Assisted Workflow

The ability to prompt, verify, and troubleshoot JOIN queries in a professional analytical workflow.

Multi-Table Reporting

The foundation for relational analytics, BI dashboards, and business intelligence workflows.

Certificate

Certificate of Completion from the Canadian Institute of Artificial Intelligence (CiAI), powered by DataSoSi.