You are here:   HomeStructured Query (SQL)SQL TutorialsSQL ORDER BY
by Dinesh Thakur Category: SQL Tutorials

A select statement is used to select information from one or more tables. SQL statements can be on one or more lines. SQL is not case sensitive. SELECT is the same as select. SQL SELECT Syntax

 

SELECT column_name(s)
FROM table_name

OR SELECT * FROM table_name

 



If all columns of a table should be selected, the asterisk symbol * can be used to denote all attributes. The query retrieves all tuples with all columns from the table EMP. To illustrate the usage of the SELECT command we are going to use the EMP table:

 

If the User is interested to finds the specified columns from a table are specified by keyword Select. SELECT identifies what columns. This operation is also called projection. The SQL statement below shows a simple usage of the SQL SELECT command with columns:

 

SELECT ENAME, SAL, EMPNO FROM EMP;

 

ENAMESALEMPNO
SMITH8007369
ADAMS11007876
JAMES9507900
MILLER13007934
ALLEN16007499
WARD12507521
MARTIN12507654
TURNER15007844
JONES29757566
BLAKE28507698
CLERK24507782
SCOTT30007788
FORD30007902
KING50007839

 

The SQL query starts with the SELECT keyword followed by a number of columns. This number of Columns specifies which columns you want to retrieve from your table. The list of columns is followed by the SQL keyword FROM and the table name (the table we are selecting data from).

 

Instead of an attribute name, the select clause may also contain arithmetic expressions involving arithmetic operators etc. For Example

 

SELECT 2+2 FROM DUAL;





About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular





Search Content







Advance Courses



Basic Courses



Advertise with Us