how to find average in sql
snippet in sql

sql count

user9025

/*COUNT(column_name) will return the number of rows from the column 
that are not NULL*/
SELECT COUNT(column_name)
FROM table_name;

/*COUNT(*) will return the number of rows from the table*/
SELECT COUNT(*)
FROM table_name;

sql avg()

user8320

/*AVG() is an aggregate function that returns the 
   average value for a numeric column*/
SELECT AVG(column_name)
FROM table_name;

select count sql

user9282


SELECT COUNT(column_name)

FROM table_name

WHERE condition; 

how to find average in sql

user3763

SELECT FIRST_NAME FROM EMPLOYEES
WHERE SALARY = (SELECT AVG(SALARY) FROM EMPLOYEES);

above average salary in sql

user1353

SELECT FIRST_NAME FROM EMPLOYEES
WHERE SALARY > (SELECT AVG(SALARY) FROM EMPLOYEES);

find below average salary in sql

user9597

SELECT first_name, salary FROM employees
WHERE salary <= (SELECT AVG(salary) FROM employees);