Order by clause-data manipulation language, Database Management System

Assignment Help:

Order by clause

  • By using this rows can be sorted
  • It is used in the last portion of select statement
  • By default it gets ascending order
  • DESC: is used for sorting in descending order
  • Sorting by column Alias
  • Sorting by column which is not in select list is possible

Example:

SELECT EMPNO, ENAME, SAL*12 "ANNUAL" FROM EMP

ORDER BY ANNUAL;

Example:   //Sorting by multiple columns//; ascending order on department number and descending order of salary in each department.

SELECT ENAME, DEPTNO, SAL FROM EMP

ORDER BY DEPTNO, SAL DESC;


Related Discussions:- Order by clause-data manipulation language

Key constraint - relational constraints, This constraint shows that the key...

This constraint shows that the key attribute value in each tuple must be unique, i.e., no two tuples have the similar value for the key attribute. This is because the value of the

OLD HOME POLICIES, Write an sql statement to find what is the percentage of...

Write an sql statement to find what is the percentage of home policies which are from the state of Arizona out of all Home policies by Policy Value.

Data base model, why are older data base model are being replaced by new da...

why are older data base model are being replaced by new data model

Create a database, Project: Microsoft Access You have been asked by the ...

Project: Microsoft Access You have been asked by the ABC Tanning Salon to create a database that can be used to track the salon's customers.  You are to create a table in Access

What is the aim of object design, What is the aim of object design The ...

What is the aim of object design The aim of object design is to identify object which the system   contains and the interactions among them. The system implements specification

Define deadlock term, a. Define the term "deadlock". There are four conditi...

a. Define the term "deadlock". There are four conditions that must hold before deadlock is possible. Name them. b. Outline an algorithm that detects whether there is a deadlock.

Which data manipulation command combines the records, Which data manipulati...

Which data manipulation command combines the records from one or more tables ? JOIN data manipulation command combines the records from one or more tables.

What is the highest normal form of the table - normalization, In problems 1...

In problems 1 - 4, you are given the columns of a table, and a set of functional dependencies.  Determine the normal form of this table.  Remember that the normal form is the HIGHE

Define seek time, Define seek time. The time for repositioning the arm ...

Define seek time. The time for repositioning the arm is known as the seek time and it enhances with the distance that the arm is known as the seek time.

Query to list the employee name have 10000 salary, Consider employee table ...

Consider employee table of (i) and list names of department(s) for which average salary for department is more than 10,000. (SELECT d_name FROM dept WHERE d_code IN (SELECT d_c

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd