Sektion 1. Kapitel 29
single
Challenge: Calculate Average Bonus
Stryg for at vise menuen
Opgave
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 alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 29
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat