Find the output of the MySQL query based on the given Table COACH. Ignore the…

2023

Find the output of the MySQL query based on the given Table COACH. Ignore the output header.

Relevant columns of Table COACH:

GAME | SALARY
NULL | NULL
CRICKET | 60000
ATHLETICS | 80000
CRICKET | NULL

Query:
SELECT COUNT(GAME), AVG(SALARY) FROM COACH;

  1. A.

    3 70000

  2. B.

    4 35000

  3. C.

    4 70000

  4. D.

    3 35000

Attempted by 1497 students.

Show answer & explanation

Correct answer: A

COUNT(GAME) = 3 and AVG(SALARY) = 70000.

COUNT(GAME) counts only non-NULL entries in GAME. The values are NULL, CRICKET, ATHLETICS and CRICKET, so 3 values are counted.

AVG(SALARY) also ignores NULL values. The non-NULL salaries are 60000 and 80000, so (60000 + 80000) / 2 = 70000.

Ignoring column headers, the output is: 3 70000.

Explore the full course: Up Lt Grade Assistant Teacher 2025