Avsnitt 1. Kapitel 29
single
Challenge: Calculate Average Bonus
Svep för att visa menyn
Uppgift
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ösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 29
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal