Structured Query Language (SQL) · Class 12 · CBSE · Science Computer Science

A relation named STUDENT has the columns RollNo, Name, and Marks. Write an SQL query to display the Name and Marks of students whose Marks are betwee…

Practice question from Structured Query Language (SQL) (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

medium · Subjective · Q-61ECF0

A relation named STUDENT has the columns RollNo, Name, and Marks. Write an SQL query to display the Name and Marks of students whose Marks are between 60 and 80 inclusive, arranging the result in descending order of Marks.

Answer: The required query is: SELECT Name, Marks FROM STUDENT WHERE Marks BETWEEN 60 AND 80 ORDER BY Marks DESC; The BETWEEN operator includes both boundary values, 60 and 80.

Solution

The WHERE clause selects marks from 60 through 80, including both limits. ORDER BY Marks DESC sorts the selected records from the highest marks to the lowest.

More from Structured Query Language (SQL)

All of Structured Query Language (SQL)

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed