SELECT ProductName, UnitPrice
FROM Products
WHERE UnitPrice > (
SELECT AVG (UnitPrice)
FROM Products
);


SELECT ContactName
FROM Customers
WHERE CustomerID IN (
SELECT CustomerID
FROM Orders
);

SELECT
ProductName, 
UnitPrice,
(SELECT AVG(UnitPrice)
FROM Products p2
WHERE p2.CategoryID = p1.CategoryID
) AS AvgCategoryPrice
FROM Products p1;



SELECT FirstName, LastName
FROM Employees
WHERE EmployeeID IN (
SELECT o.EmployeeID
FROM Orders o
WHERE o.OrderID IN (
SELECT od.OrderID
FROM [Order Details] od
GROUP BY od.OrderID
HAVING SUM(od.UnitPrice * od.Quantity) > 500
)
);