The Olympics dataset

Reporting in SQL

Tyler Pernes

Learning & Development Consultant

Entity-Relationship (E:R) diagram

  • Visual representation of database structure
  • Lays out tables and fields
  • Identifies relationships
Reporting in SQL

Olympics dataset E:R diagram

Reporting in SQL

Olympics dataset E:R diagram

Reporting in SQL

Olympics dataset E:R diagram

SELECT *
FROM countries AS c1
JOIN country_stats AS c2
ON c1.id = c2.country_id;
Reporting in SQL

Tables and fields

Reporting in SQL

Tables and fields

Reporting in SQL

Tables and fields

Reporting in SQL

Tables and fields

Reporting in SQL

Reference for queries

Reporting in SQL

Reference for queries

Reporting in SQL

Reference for queries

SELECT 
    region, 
    SUM(pop_in_millions) AS pop_in_millions
FROM countries AS c1
JOIN country_stats AS c2
ON c1.id = c2.country_id
GROUP BY region;
Reporting in SQL

Practice time!

Reporting in SQL

Preparing Video For Download...