Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Prevent Division by Zero | Null Functions
Functions in SQL

bookChallenge: 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 bonus column 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 NULLIF to avoid division by zero, and assign the result an alias.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 5. Hoofdstuk 6
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: 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 bonus column 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 NULLIF to avoid division by zero, and assign the result an alias.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 5. Hoofdstuk 6
single

single

some-alt