Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Build Leaderboards and Sequences | Window Functions for Trends and Rankings
/
SQL for Business Intelligence Analysts
セクション 3.  4
single

single

bookChallenge: Build Leaderboards and Sequences

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Write a SQL query to identify the top 2 employees by their total sales amount.

  • For each employee, calculate the total sales amount from the sales table.
  • Assign a rank to each employee based on their total sales amount, with the highest sales getting rank 1.
  • Only include employees who are ranked in the top 2.
  • Display the following columns in the result:
    • employee_id
    • total_sales (the sum of the amount field for each employee)
    • sales_rank (the rank assigned by your window function).

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 3.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt