LoslegenKostenlos loslegen

Report 1: Most decorated summer athletes

Now that you have a good understanding of the data, let's get back to our case study and build out the first element for the dashboard, Most Decorated Summer Athletes:

Your job is to create the base report for this element. Base report details:

  • Column 1 should be athlete_name.
  • Column 2 should be gold_medals.
  • The report should only include athletes with at least 3 medals.
  • The report should be ordered by gold medals won, with the most medals at the top.

Diese Übung ist Teil des Kurses

Reporting in SQL

Kurs anzeigen

Anleitung zur Übung

  • Select athlete_name and gold_medals by joining summer_games and athletes.
  • Only include athlete_name with at least 3 gold medals.
  • Sort the table so that the most gold_medals appears at the top.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

-- Pull athlete_name and gold_medals for summer games
SELECT 
	____ AS athlete_name, 
    ____ AS gold_medals
FROM ____ AS s
JOIN ____ AS a
ON ____
GROUP BY ____
-- Filter for only athletes with 3 gold medals or more
____
-- Sort to show the most gold medals at the top
ORDER BY ____;
Code bearbeiten und ausführen