Challenge: Prevent Division by Zero
Compito
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
bonuscolumn 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
NULLIFto avoid division by zero, and assign the result an alias.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 5. Capitolo 6
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Fantastico!
Completion tasso migliorato a 2.86
Challenge: Prevent Division by Zero
Scorri per mostrare il menu
Compito
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
bonuscolumn 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
NULLIFto avoid division by zero, and assign the result an alias.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 5. Capitolo 6
single