Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Prevent Division by Zero | Null Functions
Functions in SQL

bookChallenge: Prevent Division by Zero

Tarefa

Swipe to start coding

Write a query to calculate the total bonus, the number of employees, and the average bonus per employee. Use NULLIF to prevent division by zero when calculating the average bonus per employee.

  • Calculate the sum of the bonus column and assign it an alias.
  • Count the number of employees and assign it an alias.
  • Divide the total bonus by the number of employees using NULLIF to avoid division by zero, and assign the result an alias.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 5. 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

close

bookChallenge: Prevent Division by Zero

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Write a query to calculate the total bonus, the number of employees, and the average bonus per employee. Use NULLIF to prevent division by zero when calculating the average bonus per employee.

  • Calculate the sum of the bonus column and assign it an alias.
  • Count the number of employees and assign it an alias.
  • Divide the total bonus by the number of employees using NULLIF to avoid division by zero, and assign the result an alias.

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 5. Capítulo 6
single

single

some-alt