Find the output of the MySQL query based on the given Table-STUDENT (ignore…
2023
Find the output of the MySQL query based on the given Table-STUDENT (ignore the output header) (Table Data Provided) Query: SELECT SEC, AVG (MARKS) FROM STUDENT GROUP BY SEC HAVING MIN (MARKS) > 80;
S1D | SNAME | SEC | MARKS |
|---|---|---|---|
101 | Ameena | A | 83 |
107 | Arjun | B | 86 |
112 | Albert | B | 80 |
120 | Akram | A | 85 |
- A.
B 83
- B.
A 84
- C.
A 84 B 83
- D.
A 83 B 80
Attempted by 1249 students.
Show answer & explanation
Correct answer: B
Key insight: HAVING filters groups after aggregation; MIN(MARKS) > 80 keeps only groups whose minimum mark is greater than 80.
For section A: marks = 83, 85. MIN(MARKS) = 83 which is > 80, so this group is included. AVG(MARKS) = (83 + 85) / 2 = 84.
For section B: marks = 86, 80. MIN(MARKS) = 80 which is not > 80, so this group is excluded by the HAVING clause.
Final result:
One row: SEC = A, AVG(MARKS) = 84
A video solution is available for this question — log in and enroll to watch it.