(iii) SELECT SNAME, MARKS FROM STUDENT WHERE SECTION = 2 ORDER BY MARKS DESC;
Answer:
Answer by student
The output of the SQL query is:
|
SNAME |
MARKS |
|
PRIYA |
90 |
|
ANITA |
80 |
|
RAHUL |
65 |
|
PREETI |
60 |
Detailed answer by teachoo
-lock-
The given query selects the SNAME and MARKS columns from the table STUDENT, but only for those rows where the SECTION column is equal to 2 . This means that it will only consider the students who belong to section 2. The query also orders the output by the MARKS column in descending order. This means that it will arrange the output from highest to lowest marks. Therefore, the output of this query is:
|
SNAME |
MARKS |
|
PRIYA |
90 |
|
ANITA |
80 |
|
RAHUL |
65 |
|
PREETI |
60 |
-endlock-