• Following query will get you result for

    Return the number of sales by product category where the average recommended price is

    R10 or more

    SELECT COUNT(S.SalesID)

    FROM tblSales AS s

    INNER JOIN tblProducts AS P ON

    S.productID = P.productID

    GROUP BY p.catercory

    HAVING AVG(P.recommendedPRice) >= 10

    If you want to also check for recommended price greater than the average sales price you have to add following addtional checks

    OR AVG(P.recommendedPRice) > AVG(S.salePrice)