Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Trend and Percentile Analysis | Window Functions for Trends and Rankings
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
SQL for Business Intelligence Analysts

bookChallenge: Trend and Percentile Analysis

Tarefa

Swipe to start coding

You are a business intelligence analyst evaluating employee performance over time. Your goal is to analyze how employees' sales achievements change from one review to the next and how they rank compared to their peers on each review date.

Write a SQL query that:

  • Lists each employee from the Sales department and their sales achieved for each review date.
  • Shows the sales achieved on the previous review for the same employee (if any) using a window function.
  • Calculates the percentile rank of each employee's sales achieved among all employees for that review date using a window function.
  • Includes the following columns in your result: employee_id, review_date (as date), sales_achieved, previous_sales_achieved, and percentile.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 6
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain this in simpler terms?

What are the next steps I should take?

Can you provide an example?

close

bookChallenge: Trend and Percentile Analysis

Deslize para mostrar o menu

Tarefa

Swipe to start coding

You are a business intelligence analyst evaluating employee performance over time. Your goal is to analyze how employees' sales achievements change from one review to the next and how they rank compared to their peers on each review date.

Write a SQL query that:

  • Lists each employee from the Sales department and their sales achieved for each review date.
  • Shows the sales achieved on the previous review for the same employee (if any) using a window function.
  • Calculates the percentile rank of each employee's sales achieved among all employees for that review date using a window function.
  • Includes the following columns in your result: employee_id, review_date (as date), sales_achieved, previous_sales_achieved, and percentile.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 6
single

single

some-alt