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: FirstName, LastName, CountFrance, CountAll, and PercentageFrance (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 EmployeeID, FirstName, and LastName.

To calculate percentages, you should divide the numerator by the denominator (cast to float) and then multiply it by 100. Remember to round the result to one decimal place.