This question is based on the following SQL Table. Mr. Aman, a Computer Science Teacher maintains the details of his class 12 Students is a SQL table as…
This question is based on the following SQL Table.
Mr. Aman, a Computer Science Teacher maintains the details of his class 12 Students is a SQL table as follow :
Table Name : 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
Which of the following command can display the SEC wise Average of the student ?
Show answerHide answer
Correct answer: (C) SELECT *SEC, AVG (MARKS) FROM MYSTUDENT GROUP BY SEC;
Explanation
Section-wise averages need GROUP BY SEC with SELECT SEC, AVG(MARKS); ORDER BY only sorts and does not form groups, and GROUP BY MARKS groups the wrong column. Option C is the intended query (the "*" is a printing slip).