Challenge: 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
COALESCEfunction to replace anyNULLvalue in thebonuscolumn with zero. - Calculate the average of these values.
- The result should be a single column named
avg_bonus.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 5. Capítulo 5
single
Pregunte a AI
Pregunte a AI
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?
Genial!
Completion tasa mejorada a 2.86
Challenge: 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
COALESCEfunction to replace anyNULLvalue in thebonuscolumn with zero. - Calculate the average of these values.
- The result should be a single column named
avg_bonus.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 5. Capítulo 5
single