This question is based on the following SQL table MYSTUDENT : ROLLNO NAME SEC…
2022
This question is based on the following SQL table MYSTUDENT :
ROLLNO | NAME | SEC | MARKS |
|---|---|---|---|
80105 | MARIA | A | 83.0 |
80108 | AMAR | B | 44.0 |
80109 | MANPREET | A | 92.0 |
80112 | SAMEER | A | 81.0 |
80115 | AKBAR | B | NULL |
Write the output of the following command: SELECT AVG(MARKS) FROM MYSTUDENT;
----------------------------------------
- A.
AVG(MARKS)
60.0
- B.
AVG(MARKS)
300.0
- C.
AVG(MARKS)
Error
- D.
AVG(MARKS)
75.0
Attempted by 1480 students.
Show answer & explanation
Correct answer: D
The AVG() function ignores NULL values. Values considered: 83.0
44.0
92.0
81.0
Sum = 83.0 + 44.0 + 92.0 + 81.0 = 300.0 Average = Sum ÷ 4 = 300.0 ÷ 4 = 75.0 Query output: AVG(MARKS) 75.0
A video solution is available for this question — log in and enroll to watch it.