Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Multiple metrics for a single object
Metrics for two groups
Ratios and percentages
11. Calculating percentages in groups – exercise
Global vs. specific metrics
Summary

Instruction

Good job! Let's do one more exercise.

Exercise

For each employee, find the percentage of all orders they processed that were placed by customers in France. Show five columns: first_name, last_name, count_france, count_all, and percentage_france (rounded to one decimal point).

Note: To find the country where a customer is based, use the country column from the customers table.

Stuck? Here's a hint!

To find customers from France, join the orders and customers tables. Use the country column from the latter table.

You will also need the employees table.

Remember to group by employee_id, first_name, and last_name.

To calculate percentages, you should divide the numerator by the denominator and then multiply it by 100. Remember to round the result to one decimal point.