In SQL, which of the following code is correct for filtering the average?

  • A. SELECT AVG(age), gender FROM tblcustomer WHERE gender = ‘male’
  • B. SELECT AVG(age), gender FROM tblcustomer GROUP BY gender = ‘male’
  • C. SELECT AVG(age), gender FROM tblcustomer GROUP BY gender HAVING gender = ‘male’
  • D. None correct

Answer: Option A