SQL ORDER BY - Overview, syntax

          

SQL ORDER BY - Overview, syntax

SQL ORDER BY - Introduction and syntax

<<Previous  Next>>  

Explain the SQL ORDER BY statement. Write SQL syntax for the SQL ORDER BY statement along with an example.

ORDER BY: It is used to sort columns of a result set. It sorts columns in ascending order by default. DESC can be used to sort in a descending order.

Syntax:
SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC|DESC

Example:
SELECT balance FROM Account ORDER BY balance DESC


Explain the SQL WHERE statement. Write SQL syntax for the SQL WHERE statement along with an example.

WHERE: It is used to fetch records that fulfill a specified condition.................

SQL SELECT INTO

SQL SELECT INTO: The SELECT INTO statement selects data from one table and inserts it into a different table. Used often for creating back up’s............

SQL NOT NULL

SQL NOT NULL: The NOT NULL constraint enforces a column to NOT accept NULL values..............

SQL LIKE

LIKE clause is used for pattern matching. % is used to match any string of any length where as _ allows you to match on a single character................

SQL IN

The IN operator allows you to specify multiple values in a WHERE clause................

<<Previous  Next>>   



Write your comment - Share Knowledge and Experience


 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring