Challenge: Calculate Average Bonus
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 5. Capitolo 5
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Suggested prompts:
Can you explain that in more detail?
What are the main benefits or drawbacks?
Can you give me an example?
Fantastico!
Completion tasso migliorato a 2.86
Challenge: Calculate Average Bonus
Scorri per mostrare il menu
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 5. Capitolo 5
single