Challenge: Calculate Average Bonus
Aufgabe
Swipe to start coding
Write a query to calculate the average bonus for all employees in the employees table, treating any NULL bonus values as zero.
- Use the
COALESCEfunction to replace anyNULLvalue in thebonuscolumn with zero. - Calculate the average of these values.
- The result should be a single column named
avg_bonus.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 5. Kapitel 5
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Suggested prompts:
Can you explain that in more detail?
What are the main benefits or drawbacks?
Can you give me an example?
Großartig!
Completion Rate verbessert auf 2.86
Challenge: Calculate Average Bonus
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
Write a query to calculate the average bonus for all employees in the employees table, treating any NULL bonus values as zero.
- Use the
COALESCEfunction to replace anyNULLvalue in thebonuscolumn with zero. - Calculate the average of these values.
- The result should be a single column named
avg_bonus.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 5. Kapitel 5
single