CBSE Class 12 Informatics Practices Question 27 of 90

Querying Using SQL — Question 5

Back to all questions
5
Question

Question 5

Select correct SQL query from below to find the temperature in increasing order of all cities.

  1. SELECT city FROM weather ORDER BY temperature ;

  2. SELECT city, temperature FROM weather ;

  3. SELECT city, temperature FROM weather ORDER BY temperature ;

  4. SELECT city, temperature FROM weather ORDER BY city ;

Answer

SELECT city, temperature FROM weather ORDER BY city ;

Reason — The query SELECT city, temperature FROM weather ORDER BY city ; selects the city and temperature columns from the weather table and sorts the result set by the city column in ascending order.