A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
bartleby

Concept explainers

Question
Book Icon
Chapter 5, Problem 6SCG
Program Plan Intro

ORDER BY Clause:

SQL contains “ORDER BY” clause in order to sort rows. The values get sorted in ascending as well as descending order. The keyword used to sort values in ascending order is “ASC” and for descending order is “DESC”. By default, it sorts values by ascending order.

Syntax:

SELECT column_Name1, column_Name2 FROM table_Name ORDER BY column_Name2;

Blurred answer
Students have asked these similar questions
Find the first names and last names of employees if they got a salary increase more than 10% in the first month of 2000 together with their salary change dates, old salaries, new salaries, and increase percentages in descending order by their increase percentages.
Who has rented movies in Japanese language? Return only the first five distinct results in alphabetical order by last name.(Hints: In the language table, there is a field “name” that contains the film language names.) Display: first name and last name
INPUT TABLE You're given a orders table and the columns in the orders table are shown below: Orders Order_Id INT Type VARCHAR(10) Red_Shipping_ Days INT Scheduled_Shipping_Days INT Customer_Id INT Order _city VARCHAR(20) Order_Date DATE Order_Region VARCHAR(15) Order_State VARCHAR(20) Order _Status VARCHAR(20) Shipping_Mode VARCHAR(20)   QUERY Calculate count of all the orders. Where Order_ State is Maharashtra Note - Use the alias of oc for count of orders Group the results by Type Order them by oc in ascending order.   OUTPUT COLUMNS oc, Type
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning