English

State the command to display the average marks scored by students of each gender who are in class XI? (i) Select Gender, avg(Marks) from STUDENT where Class= "XI" group by Gender; -

Advertisements
Advertisements

Question

Consider the table STUDENT given below:

RollNo Name Class DOB Gender City Marks
1 Anand XI 6/6/97 M Agra 430
2 Chetan XII 7/5/94 M Mumbai 460
3 Geet XI 6/5/97 F Agra 470
4 Preeti XII 8/8/95 F Mumbai 492
5 Saniyal XII 8/10/95 M Delhi 360
6 Maakhiy XI 12/12/94 F Dubai 256
7 Neha X 8/12/95 F Moscow 324
8 Nishant X 12/6/95 M Moscow 429

State the command to display the average marks scored by students of each gender who are in class XI?

(i) Select Gender, avg(Marks) from STUDENT where Class= "XI" group by Gender;

(ii) Select Gender, avg(Marks) from STUDENT group by Gender where Class="XI";

(iii) Select Gender, avg(Marks) group by Gender from STUDENT having Class="XI";

(iv) Select Gender, avg(Marks) from STUDENT group by Gender having Class = "XI";

Choose the correct option:

Options

  • Both (ii) and (iii)

  • Both (ii) and (iv)

  • Both (i) and (iii)

  • Only (iii)

MCQ

Solution

Both (ii) and (iv)

Explanation:

The AVG() function returns the average value of a numeric column.

shaalaa.com
Functions in SQL
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×