Concept explainers
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;
WHERE clause:
“WHERE” statement is used limit the number of rows.
For example: Consider a table “FTable” that has two columns named “FruitName” and “Color”. “WHERE” clause is used when there is a need to display the entire FruitName whose color is Red.
SELECT * FROM FTable WHERE color = 'red';
When the above statement is executed, red colored fruits get displayed.
Trending nowThis is a popular solution!
Chapter 7 Solutions
Database Systems: Design, Implementation, & Management
- Based on the reference table, write a query to get list name of employee who have registered more than 10 orders. Table Order OrderQty 10 5 4 CustomeriD EmployeelD OrderDate ShipperiD 4/7/1996 5/7/1996 8/7/1996 2 90 81 1 34 81 8/7/1996 Table_Employee EmployeelD FirstName BirthDate Nancy Andrew Janet LastName Photo Notes 1 Davolio 2 Fuller 3 Leverling 8/12/1968 EmpID1.pic 19/2/1952 EmplID2.pic 30/8/1963 EmpID3.pic Education includes a BA.. Andrew received his BTS.. Janet has a BS degree.arrow_forwardWrite a query to list the book number, title, and number of times each book has been checked out more than five times. Sort the results in descending order by the number of times checked out.arrow_forward