-- 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 ] |
-- -- What is the contact name and phone number of the customer who has made the most total payment on the order to date?

SELECT T1.ContactName, T1.Phone FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID GROUP BY T2.OrderID, T1.ContactName, T1.Phone ORDER BY SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) DESC LIMIT 1;