From the course: Intermediate SQL: Data Reporting and Analysis

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Challenge: Report average cost by staff

Challenge: Report average cost by staff - SQL Tutorial

From the course: Intermediate SQL: Data Reporting and Analysis

Challenge: Report average cost by staff

(upbeat music) - [Instructor] Imagine you work in the movie rental head office doing payment analysis and you want to know if there is any difference between staff members in the average cost of the movies they've rented out in 2006. You're going to look at the payment and staff tables and compare the average cost of the amount column by staff member. You should limit yourself to 2006, reporting two columns, one containing the full name from the staff table and the other containing the average amount from the payment table. You should only be reporting two rows because there are only two staff members. You should be using a number function, date function, and a string function in this query. You may find it easiest to use table aliases. This should take you no more than five minutes. Good luck.

Contents