-- Database schema
| Categories : CategoryID [ INTEGER ] primary_key , CategoryName [ TEXT ] , Description [ TEXT ] | Customers : CustomerID [ INTEGER ] primary_key , CustomerName [ TEXT ] , ContactName [ TEXT ] , Address [ TEXT ] , City [ TEXT ] , PostalCode [ TEXT ] , Country [ TEXT ] | Employees : EmployeeID [ INTEGER ] primary_key , LastName [ TEXT ] , FirstName [ TEXT ] , BirthDate [ DATE ] , Photo [ TEXT ] , Notes [ TEXT ] | Shippers : ShipperID [ INTEGER ] primary_key , ShipperName [ TEXT ] , Phone [ TEXT ] | Suppliers : SupplierID [ INTEGER ] primary_key , SupplierName [ TEXT ] , ContactName [ TEXT ] , Address [ TEXT ] , City [ TEXT ] , PostalCode [ TEXT ] , Country [ TEXT ] , Phone [ TEXT ] | Products : ProductID [ INTEGER ] primary_key , ProductName [ TEXT ] , SupplierID [ INTEGER ] Products.SupplierID = Suppliers.SupplierID , CategoryID [ INTEGER ] Products.CategoryID = Categories.CategoryID , Unit [ TEXT ] , Price [ REAL ] | Orders : OrderID [ INTEGER ] primary_key , CustomerID [ INTEGER ] Orders.CustomerID = Customers.CustomerID , EmployeeID [ INTEGER ] Orders.EmployeeID = Employees.EmployeeID , OrderDate [ DATETIME ] , ShipperID [ INTEGER ] Orders.ShipperID = Shippers.ShipperID | OrderDetails : OrderDetailID [ INTEGER ] primary_key , OrderID [ INTEGER ] OrderDetails.OrderID = Orders.OrderID , ProductID [ INTEGER ] OrderDetails.ProductID = Products.ProductID , Quantity [ INTEGER ] |
-- -- Among the employees who handled orders to Brazil, who has the highest salary and calculate the average salary of them.

SELECT T1.FirstName, T1.LastName, AVG(T1.Salary) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.ShipCountry = 'Brazil' GROUP BY T1.FirstName, T1.LastName ORDER BY SUM(T1.Salary) DESC LIMIT 1;