Skip to content

Show sales per employee (staff) and year in sakila db?

I’m kind of stuck on an excercise concerning the sakila db. I want to show sales per employee (staff) and year in mySQL and I’m failing at using the staff_id’s correctly.

This is all I have so far:

Can anyone explain to me how to use the staff_id in both staff and payment to display sales per employee?

Advertisement

Answer

You can use group by and aggregate function sum as follows:

User contributions licensed under: CC BY-SA
6 People found this is helpful