Reporting in SQL
Plan multi-table SQL queries, clean messy data and build window-function calculations while creating four reports on an Olympics database.
Reporting in SQL is about building clear reports with SQL and keeping them accurate and interpretable through data cleaning and validation. Working with an Olympics database of athletes, events, regions and country GDP, you plan queries with an ER diagram, repair data type and string problems, handle nulls and duplicate rows, and add calculations built on window functions.
What You Will Achieve
- Read an ER diagram to decide which tables a report needs and how they connect
- Combine several tables with joins and unions to answer a specific business question
- Track down wrong data types, null values and duplicate rows that distort report totals
- Use window functions to compare each country or region against a total and track changes week over week
Program Overview
Exploring the Olympics Dataset
Get familiar with the athletes, events and regions data before writing reports that answer business questions.
- The Olympics dataset and its tables
- Planning queries with an ER diagram
- Exploring and validating query results
- A base report on the most decorated summer athletes
Planning and Building Complex Queries
A step-by-step method for planning a large query that combines tables in several ways and adds custom fields.
- Planning the SELECT statement and filters
- JOIN and UNION in either order
- Custom fields with CASE statements
- Filtering with a JOIN or a subquery
Cleaning Messy Data and Complex Calculations
Fix messy real-world data, then add window functions and layered calculations that compare groups, dates and countries.
- Data type conversion and string cleaning
- Null handling with COALESCE and removing duplication
- Window functions and layered calculations
- Percent of total and performance index metrics
Certificate Awarded (Paid)
Job Outlook
These skills apply wherever people pull data from relational databases to build regular reports, including business analysis and data science work that also uses R or Python.
Good for: Analysts who already write SQL queries and want a structured way to plan, check and build reports on one realistic database.
Keep in mind: The chapters center on writing and checking the SQL behind four reports, not on charts or dashboard design.
Bottom line: Four worked reports on one Olympics database make this a practical drill in planning, cleaning and validating SQL output.
Frequently Asked Questions
What data do the reports use?
Every lesson works on one Olympics database with tables on athletes, summer games, events, regions and country figures such as GDP. Each chapter closes with a report built on it, such as the most decorated summer athletes or countries with high medal rates.
How does the course approach large queries?
The second chapter plans a query before writing it, settling the SELECT list, then the filter, then how the tables combine. It compares joining before a union with a union before a join, adds CASE-based fields such as a BMI bucket by sport, and filters with a join or a subquery.
What kinds of data problems does the cleaning chapter fix?
It deals with wrong data types and the error messages they cause, date functions applied to text, messy strings that need substrings replaced or removed, incorrect groupings, nulls that break calculations, and duplicate rows in a report, which are fixed through a join.
What calculations use window functions?
The final chapter uses window functions and layered calculations to compare groups: average country medals by region, the most decorated athlete per region, percent of GDP per country, a GDP per capita performance index, and month-over-month and week-over-week comparisons.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.