Overview

Course Overview β€” Beginner SQL Commands 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

Beginner SQL Commands
Practice

A hands-on SQL course built on repetition and practical business exercises — mastering the six core SQL commands every analyst uses every day.

This course is not a lecture series — it is a practice-first SQL program. Across six parts, you will work through 48 business-focused SQL queries using real-style datasets covering users, transactions, orders, products, subscriptions, and support tickets. Every query comes with an AI prompt and a validated SQL answer, so you learn to write, prompt, verify, and interpret SQL output in the same workflow analysts use in industry.
6 Parts
48 Practice Queries
7 Course Tables
AI-Assisted Learning
Certificate of Completion

Course Learning Objectives

  • Retrieve business data from relational tables using SELECT — all columns, specific columns, and aliased output.
  • Filter records with precision using WHERE — comparison operators, AND/OR logic, IN, BETWEEN, LIKE, and IS NULL.
  • Sort query results using ORDER BY — ascending and descending, single and multi-column sort.
  • Restrict output and build Top N reports using LIMIT in combination with ORDER BY.
  • Group records into business categories and apply aggregation functions using GROUP BY — COUNT, SUM, AVG, MIN, MAX.
  • Filter grouped summaries using HAVING to apply business thresholds and identify meaningful categories.
  • Use AI tools effectively to generate, verify, and troubleshoot SQL queries against real business questions.
Six parts — click any part to see its topics and practice focus.
Foundation

Part 1 establishes the foundation. SELECT is the first command in every SQL query — it names the columns to retrieve and the table to retrieve them from. Students learn to select all columns with *, select specific columns by name, rename columns with AS aliases, and read table structures as a first step in any new analysis.

Topic 1
What SELECT Does

The two-line SELECT…FROM structure that underpins every SQL query.

Topic 2
Selecting All Records

Using SELECT * to return every column from a table when exploring a dataset.

Topic 3
Retrieving Specific Columns

Naming the exact columns you need for focused, analyst-ready output.

Topic 4
Aliases with AS

Renaming columns in query output using AS for reports and dashboards.

  • Practice focus: retrieving business data from the users, products, orders, and transactions tables
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Filtering

Part 2 adds filtering. WHERE narrows a query from all records to only the rows that meet a specific condition. Students work through every WHERE pattern used in business analytics — from simple equality checks to multi-value lists, ranges, pattern matching, and NULL identification.

Topic 1
Filtering Records

How WHERE evaluates each row and returns only those that match the condition.

Topic 2
Using =, !=, >, <

Comparison operators for exact matches, exclusions, and numeric thresholds.

Topic 3
AND / OR

Combining multiple conditions — AND requires all, OR requires any.

Topic 4
IN, BETWEEN, LIKE

Shorthand operators for multiple values, ranges, and pattern searches.

Topic 5
IS NULL / IS NOT NULL

Identifying missing or present data — essential for data quality and subscription analysis.

  • Practice focus: isolating relevant business records from users, transactions, orders, and subscriptions
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Sorting

Part 3 adds sorting. ORDER BY organizes query output into a logical sequence — alphabetical, chronological, or by value. Students practise ascending and descending sorts, multi-column sort hierarchies, and combining ORDER BY with WHERE filters to produce organized business reports.

Topic 1
Sorting Results

How ORDER BY controls the sequence in which rows are returned.

Topic 2
ASC and DESC

Ascending (low to high, oldest to newest) and descending (high to low, newest to oldest).

Topic 3
Sorting by Multiple Columns

Using more than one column to produce a precise, multi-level sort order.

  • Practice focus: organizing data for reporting and analysis across users, transactions, products, subscriptions, and support tickets
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Top N

Part 4 introduces LIMIT. Students learn to cap query output at a fixed row count, combine LIMIT with ORDER BY to build Top N business reports, and understand the correct SQL clause order: SELECT → FROM → WHERE → ORDER BY → LIMIT.

Topic 1
Restricting Output

How LIMIT stops query results after a fixed number of rows.

Topic 2
Top N Queries

Combining ORDER BY with LIMIT to retrieve the highest or lowest N records.

Topic 3
Combining LIMIT with Sorting

Using WHERE, ORDER BY, and LIMIT together for focused ranked subsets.

  • Practice focus: retrieving focused subsets of business data — top transactions, cheapest products, most recent orders
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Aggregation

Part 5 introduces aggregation. GROUP BY organizes records into categories and applies COUNT, SUM, AVG, MIN, or MAX to produce one summary row per group. Students build the grouped business metrics used in dashboards, reports, and operational summaries.

Topic 1
Grouping Records

How GROUP BY collapses rows with the same category value into a single summary row.

Topic 2
Aggregation by Category

Applying COUNT(), SUM(), AVG(), MIN(), and MAX() to calculate grouped metrics.

Topic 3
Business Summaries

Building the summary outputs that power dashboards, reports, and KPI tracking.

  • Practice focus: calculating grouped business metrics across users, transactions, orders, products, subscriptions, and support tickets
  • 8 practice queries — each with an AI prompt and a validated SQL answer
Threshold Analysis

Part 6 completes the core SQL command set. HAVING filters the grouped summaries produced by GROUP BY — applying business thresholds to aggregated data. Students learn the critical distinction between WHERE (filters rows before grouping) and HAVING (filters groups after aggregation), and practise the full clause order: SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY → LIMIT.

Topic 1
Filtering Grouped Results

How HAVING evaluates each group summary and keeps only those meeting the condition.

Topic 2
Aggregation Conditions

Using HAVING with COUNT(), SUM(), and AVG() to filter grouped output.

Topic 3
Business Threshold Analysis

Applying business rules to summarized data — revenue thresholds, volume minimums, price benchmarks.

  • Practice focus: identifying meaningful grouped insights across users, transactions, orders, products, subscriptions, and support tickets
  • 8 practice queries — each with an AI prompt and a validated SQL answer

Course at a Glance

Six parts · 48 practice queries · 7 course tables

PartCommandCore FocusPractice
Part 1SELECTRetrieving columns, SELECT *, aliases with AS, reading table structures8 Queries
Part 2WHEREFiltering rows, =, !=, >, <, AND/OR, IN, BETWEEN, LIKE, IS NULL8 Queries
Part 3ORDER BYSorting results ASC and DESC, multi-column sorting8 Queries
Part 4LIMITRestricting output, Top N queries, combining with ORDER BY8 Queries
Part 5GROUP BYGrouping records, aggregation by category, business summaries8 Queries
Part 6HAVINGFiltering grouped results, aggregation conditions, business thresholds8 Queries
AI-Assisted SQL Learning

Every practice question in this course includes a business question, an AI prompt designed for ChatGPT or Copilot, the validated SQL answer, and guidance on interpreting the result. Students learn to prompt AI effectively, verify SQL correctness, troubleshoot logic issues, and connect query output to real business decisions.

What You Leave With

Six commands. Forty-eight practice queries. One complete SQL foundation.

SELECT

The ability to retrieve any combination of columns from any table — the foundation of every SQL query.

WHERE

Precision filtering using every operator analysts use in industry — from equality checks to NULL identification.

ORDER BY

The ability to sort and rank business data for reports, dashboards, and Top N analysis.

LIMIT

Focused dataset retrieval — previewing large tables and building Top N business reports efficiently.

GROUP BY

Grouped business metrics — COUNT, SUM, AVG — for revenue summaries, fulfilment rates, and operational KPIs.

HAVING

Threshold-based filtering on aggregated data — surfacing only the categories that meet meaningful business criteria.

AI-Assisted Workflow

The ability to prompt, verify, and troubleshoot AI-generated SQL in the same workflow used by professional analysts.

Certificate

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