Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Calculate Average Bonus | Null Functions
Functions in SQL

bookChallenge: Calculate Average Bonus

Tarea

Swipe to start coding

Write a query to calculate the average bonus for all employees in the employees table, treating any NULL bonus values as zero.

  • Use the COALESCE function to replace any NULL value in the bonus column with zero.
  • Calculate the average of these values.
  • The result should be a single column named avg_bonus.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 5
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain that in more detail?

What are the main benefits or drawbacks?

Can you give me an example?

close

bookChallenge: Calculate Average Bonus

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write a query to calculate the average bonus for all employees in the employees table, treating any NULL bonus values as zero.

  • Use the COALESCE function to replace any NULL value in the bonus column with zero.
  • Calculate the average of these values.
  • The result should be a single column named avg_bonus.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 5
single

single

some-alt