Pathway 03 of 9

SQL and Database Management

In short: Learn SQL, the language for asking questions of a database, and how business data is stored.

SQL (Structured Query Language) is how you pull and combine data from a database. You learn to filter, join tables, and total things up. You also learn the basic design ideas, like keys and relationships, that explain why data is shaped the way it is.

EditorialBeginner New to analytics

Written by Business Analytics Hub as general guidance. Tools are named for orientation, not as endorsements. New to a term? See the glossary.

Who it is for
  • Analysts who currently depend on others to pull data
  • Students preparing for data and business analyst interviews, which often include SQL
  • Excel users ready to work with larger data
Prerequisites
  • Comfort with tables of rows and columns, for example from the Excel and Power Query pathway
  • No programming experience needed
Recommended tools
  • SQLite (a free, file-based database suitable for practice)
  • PostgreSQL
  • A SQL editor such as DBeaver or the editor built into your database tool
  • Microsoft SQL Server or MySQL, if your workplace uses them

Learning objectives

By the end of this pathway you should be able to:

  • Write queries that select, filter, sort and limit rows
  • Join two or more tables correctly and explain what each join type returns
  • Aggregate with GROUP BY and filter groups with HAVING
  • Use subqueries, common table expressions and window functions for multi-step questions
  • Read a database diagram and explain keys, relationships and normalization

Expected competencies

What an employer or instructor could observe in your work:

  • Retrieves exactly the data a question needs, efficiently and correctly
  • Checks join results for duplicated or dropped rows
  • Explains query logic to a non-technical colleague
  • Recognizes when a data model will make a question hard to answer

Suggested learning sequence

Work through the steps in order; each builds on the one before.

  1. Relational basicsTables, rows, columns, data types, primary and foreign keys.
  2. Single-table queriesSELECT, WHERE, ORDER BY, LIMIT, and handling NULL values.
  3. JoinsInner, left, right and full joins; checking row counts after every join.
  4. AggregationGROUP BY, HAVING, COUNT, SUM, AVG, and grouping by dates.
  5. Multi-step queriesSubqueries, common table expressions and window functions.
  6. Design and reliabilityNormalization, indexes at a conceptual level, and data integrity constraints.

Practical exercises

Use any dataset you are allowed to work with, or the labeled synthetic datasets in the Analytics Lab.

  1. Using an orders, customers and products database, list the top ten customers by revenue in the last quarter.
  2. Find customers who ordered in one year but not the next. Explain which method you used and why.
  3. Calculate a running monthly total and month-over-month change with a window function.
  4. Draw the tables and relationships for a small appointment-booking business and mark the primary and foreign keys.

Learning resources and related projects

Every outside resource is checked against its source and dated before it is listed. Related practice projects come from the Analytics Lab.

  • Resource

    Verified 2026-12-02

    PostgreSQL tutorial

    The official tutorial from the PostgreSQL project. It teaches SQL basics on a real database system.

    Beginner · tutorial · free

  • Resource

    Verified 2026-12-02

    SQLBolt: learn SQL

    Short interactive lessons and exercises that you finish in the browser. A gentle way to start with SQL.

    Beginner · tutorial · free

Browse the Resource Library   Visit the Analytics Lab