Challenge: Prevent Division by Zero
Taak
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.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 5. Hoofdstuk 6
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 2.86
Challenge: Prevent Division by Zero
Veeg om het menu te tonen
Taak
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.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 5. Hoofdstuk 6
single