Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
240 views
in Programming by (240k points)
closed by

Consider the following SQL query:

SELECT title, name

FROM Employee

ORDER BY title, name DESC:

In output of above query the different titles are listed in ___________ order the names of employees having same title are listed in ___________ order.


1. Ascending, Ascending
2. Ascending, Descending
3. Descending, Ascending
4. Descending, Descending

1 Answer

0 votes
by (238k points)
selected by
 
Best answer
Correct Answer - Option 2 : Ascending, Descending

The ORDER BY command is used to sort the result set in ascending or descending order.

The ORDER BY command sorts the result set in ascending order by default. To sort the records in descending order, use the DESC keyword

Syntax

SELECT * FROM table_name ORDER BY column_name ASC | DESC

  • table_name: name of the table.
  • column_name: name of the column according to which the data is needed to be arranged.
  • ASC: to sort the data in ascending order.
  • DESC: to sort the data in descending order.
  • | : use either ASC or DESC to sort in ascending or descending order

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...