SELECT Customers.CustomerID, Customers.LastName, Customers.FirstName, COUNT(Orders.OrderID) AS 'No. of Orders', SUM(Orders.Price) AS 'Total of Purchases'
FROM Customers
INNER JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
GROUP BY Orders.CustomerID;
-- You can count the rows in a table by using COUNT(1)
SELECT COUNT(1) AS 'Number of Rows in Customers Table' FROM Customers