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
Identify the most Suitable Command to display the merit List of his students where the details will be displayed in descending order of their marks. If some students have same MARKs, their detail will be displayed in ascending order of their ROLLNO.
Show answerHide answer
Correct answer: (B) SELECT * FROM MYSTUDENT ORDER BY MARKS DESC, ROLLNO ASC;
Explanation
ORDER BY takes the column first and the direction after it, separated by commas: ORDER BY MARKS DESC, ROLLNO ASC sorts by marks high to low and breaks ties by roll number ascending. The other options have wrong syntax.