A sub query is a query nested inside another SQL query. Examples:

-- Example 1
SELECT *
FROM Donation
WHERE Amount >= (SELECT AVG(Amount) FROM Donation)
  
-- Example 2
SELECT * 
FROM Customer
WHERE ID IN (SELECT CustomerID FROM [Order] WHERE Amount > 1000)
  
-- Example 3
SELECT c.ID, c.FirstName, c.LastName, co.TotalOrderAmount
FROM Customer c
JOIN (
      SELECT CustomerID, SUM(Amount) TotalOrderAmount
      FROM [Order]
      GROUP BY CustomerID
) AS co ON co.CustomerID = c.ID