Challenge: Prevent Division by Zero
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 5. Luku 6
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 2.86
Challenge: Prevent Division by Zero
Pyyhkäise näyttääksesi valikon
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 5. Luku 6
single