how to find average in sql code example
Example 1: sql count
SELECT COUNT(column_name)
FROM table_name;
SELECT COUNT(*)
FROM table_name;
Example 2: sql average
SELECT student_name, avg(notes) FROM student_notes GROUP BY student_name;
Example 3: sql avg()
SELECT AVG(column_name)
FROM table_name;
Example 4: how to find average in sql
SELECT FIRST_NAME FROM EMPLOYEES
WHERE SALARY = (SELECT AVG(SALARY) FROM EMPLOYEES);
Example 5: above average salary in sql
SELECT FIRST_NAME FROM EMPLOYEES
WHERE SALARY > (SELECT AVG(SALARY) FROM EMPLOYEES);
Example 6: find below average salary in sql
SELECT first_name, salary FROM employees
WHERE salary <= (SELECT AVG(salary) FROM employees);