

InterviewSolution
Saved Bookmarks
1. |
Find the temperature in increasing order of all cities(a) SELECT city FROM weather ORDER BY temperature;(b) SELECT city, temperature FROM weather;(c) SELECT city, temperature FROM weather ORDER BY temperature;(d) SELECT city, temperature FROM weather ORDER BY city;I had been asked this question during a job interview.Enquiry is from Structured Query Language topic in portion SQL Basics of Oracle |
Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/correct-409949" style="font-weight:bold;" target="_blank" title="Click to know more about CORRECT">CORRECT</a> answer is (c) <a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a> city, temperature FROM <a href="https://interviewquestions.tuteehub.com/tag/weather-1450884" style="font-weight:bold;" target="_blank" title="Click to know more about WEATHER">WEATHER</a> ORDER BY temperature;<br/><br/>To explain I would say: SELECT column_name, aggregate_function(column_name)<br/><br/> FROM table_name<br/><br/> WHERE column_name <a href="https://interviewquestions.tuteehub.com/tag/operator-1137101" style="font-weight:bold;" target="_blank" title="Click to know more about OPERATOR">OPERATOR</a> value<br/><br/> <a href="https://interviewquestions.tuteehub.com/tag/group-1013370" style="font-weight:bold;" target="_blank" title="Click to know more about GROUP">GROUP</a> BY column_name<br/><br/> HAVING aggregate_function(column_name) operator value<br/><br/> ORDER BY ; <br/><br/>So base on [SELECT city, temperature FROM weather ORDER BY temperature;] this will be the correct answer.</body></html> | |