Learn SQL for data analysis: a practical online pathway
Start with tables and keys and progress to CTEs and window functions using sales, marketing, finance and logistics data.
- 20 SQL practice activities
- Disposable synthetic data
- Read-only queries
At a glance
SQL for analysis means retrieving the right rows and calculating results you can explain. The course includes 20 SQL practice activities, from SELECT and filters to joins and window functions. Browser practice uses disposable synthetic data and read-only queries, so a production database is not required.
Professional Data Analyst · £83.24 · 12 calendar months
Online, self-paced written lessons and practical activities. 14 modules, 56 lessons, 120 practice activities and four portfolio projects.
Microsoft licences, Windows and the official PL-300 exam are not included.
Enrol in the full Data Analyst courseDefine a reporting period before writing the query
Consider a fictional UK order table with a transaction date, a GBP amount and a return flag. First decide whether the question concerns placed orders, completed sales or net revenue after returns. Those definitions change the filter and aggregation even when the SQL is syntactically valid.
Use an unambiguous date representation in the data and document the boundary of the period. A calendar year and an organisation’s financial year need not describe the same rows. Keep the period as a stated business rule; do not infer it from the presence of a pound sign.
- Count source rows before adding a JOIN
- Check unmatched keys and repeated order IDs
- Keep missing amounts distinct from a genuine zero
From the relational model to your first query
Before SELECT, you need to know what each table represents, what a key identifies and the level of detail of a record. This avoids joining similar but different columns.
The first exercises cover aliases, DISTINCT, WHERE, operators, ORDER BY and LIMIT with results you can check by hand.
Summarise without losing context
COUNT, SUM, AVG, MIN and MAX change meaning with the filter and granularity. GROUP BY and HAVING answer specific questions about customers, routes or campaigns.
CASE creates traceable classifications, and explicit NULL handling distinguishes absence, zero and an empty string.
JOIN, subqueries, CTEs and window functions
A correct JOIN declares the expected relationship and anticipates rows. Intentional duplicates help detect silent row multiplication.
CTEs improve readability; ROW_NUMBER, RANK, LAG and running totals compare rows with their group without collapsing them.
A lab isolated from the campus
Queries run on disposable synthetic databases in the browser. The dataset is reset and destructive statements are blocked. Nothing is sent to production MySQL.
Automatic marking covers bounded SELECT queries; it does not aim to administer servers or execute concurrent writes.
A process you can repeat for every challenge
Understanding, implementing and checking are parts of the same task.
- 01
Read
Identify tables, keys and nulls.
- 02
Predict
Anticipate rows and columns.
- 03
Query
Write a clear query.
- 04
Cross-check
Compare the result with the question.
Frequently asked questions
Specific answers about this learning pathway.
Do I need to install MySQL?
Not for automatically marked practice: it uses an isolated local engine in the browser.
Can I damage the platform?
It does not connect to production, resets the data and restricts execution to reading.
Which dialect is used?
Portable relational SQL, with relevant differences documented.
Are DELETE or UPDATE executed?
No. Executable automatic marking is limited to safe read-only operations.
Do these exercises require access to my employer’s database?
No. The automatically marked activities use synthetic datasets in an isolated browser environment. Do not paste customer records, credentials or confidential company data into a learning exercise.
Primary sources and further reading
Source links checked on 15 September 2026. Official software requirements and exam objectives can change; use the linked publisher pages when planning your study.
Build your analysis skills in one connected course
£83.24 once for 12 calendar months of access to the complete Professional Data Analyst course. No automatic renewal.
MYSERVEAI TECHNOLOGIES SL. is an independent educational platform. It is not affiliated with, authorised, sponsored or endorsed by Microsoft. Microsoft, Power BI and PL-300 are trademarks of their respective owners and are used solely descriptively.
Editorial lead: KINTAVOR editorial team · Educational product management · Content updated: 2026-09-15.