Challenge: Prevent Division by Zero
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 5. Kapitel 6
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Großartig!
Completion Rate verbessert auf 2.86
Challenge: Prevent Division by Zero
Swipe um das Menü anzuzeigen
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 5. Kapitel 6
single