開始使用免費開始

建立基礎報表

現在,請為下列視覺化建立基礎報表:

這份報表應透過查詢右下方資源總管中的 summer_games 資料表來建立。

本練習屬於課程

SQL 報表製作

檢視課程

練習說明

  • 使用右側主控台,從 summer_games 資料表選取 sport 欄位。
  • 建立 athletes 欄位,方法是計算 athlete_id 的不重複出現次數。
  • sport 欄位分組。
  • 讓報表只顯示 3 列,且 athletes 最高者排在最上面。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

-- Query the sport and distinct number of athletes
SELECT 
	____, 
    ____ AS athletes
FROM summer_games
GROUP BY ____
-- Only include the 3 sports with the most athletes
ORDER BY ____
LIMIT ____;
編輯並執行程式碼