SQL Select Keyword, SQL Tutorial, Global Guide Line Technology.
Bookmark Bookmark: SQL Select Keyword, SQL Tutorial Forum | Blog |

      Home                    

Basic SQL Guide.           
SQL Introduction.               
 What is Table?                  
 SQL Create Table.            
 SQL Insert Statement.      
 SQL Select Keyword.
 SQL Order by clause.        
 SQL Count Statement.      
 SQL Group By Clause.      
 SQL Having Clause.          
 SQL Alias Tables.             
 SQL Join Tables.              
 SQL Outer Join.               
 SQL Update Statement.   
 SQL Delete Statement.    
 SQL Distinct Keyword.      
 SQL Where Keyword.       
 SQL And Or Keyword.      
 SQL In Keyword.              
 SQL Between Keyword.   
 SQL Like Keyword.          
 SQL Functions.                
 SQL Concatenate.           
 SQL Substrings.               
 SQL Trim Function.         
 SQL Constraints.              
 SQL Primary Key.            
 SQL Foreign Key.            
 SQL Create Views.           
 SQL Create Index.           
 SQL Alter Table.             
 SQL Drop Table.             
 SQL Truncate Table.      
 SQL Summary.                

SQL Tutorial >> SQL Select Keyword.


     Back             Next     




In the previous sections, we have seen how to insert information into database tables. A common use is to select data from the tables located in a database. Immediately, we see two keywords: we need to SQL SELECT information FROM a table. Note that a table is a container that resides in the database where the data is stored. For more information about how the contains the data and from where this data came form you need to review again the previous segments of SQL Tutorial.. Hence we have the most basic SQL structure:

SELECT "column_name" FROM "table_name"

To illustrate the above example, assume that we have the following table:

Table: Employees

 

FirstName LastName Email DOB Phone
Austin Hennery austin.it@gamail.com 24/11/1978 446 102-2222
Creston Narvon narvon_crest@hotmail.com 22/04/1976 443 325-4545
Kate Bladen kbladen@usa.net 01/05/1980 326 503-3232
Angela Julie julieee@yahoo.co.uk 11/12/1977 326 323-8888
Bobbi Ferguson bobi123@kiwibox.com 10/02/1970 506 252-9875
Cute Alfa cafa@gmail.com 19/05/1972 506 272-4566
 

We shall use this table as an example throughout the SQL Tutorial (this table will appear in all lessons). To select all the employees in this table, we key in,

 

SELECT first_name FROM Employees

Result:
FirstName
Austin
Creston
Kate
Angela
Bobbi
Cute

Multiple column names can be selected, as well as multiple table names with SQL Select keyword.



To select the entire table of Employees we will use this query.


SELECT * FROM Employees

The result of the above SQL select statement will be as under

Rreult:

FirstName LastName Email DOB Phone
Austin Hennery austin.it@gamail.com 24/11/1978 446 102-2222
Creston Narvon narvon_crest@hotmail.com 22/04/1976 443 325-4545
Kate Bladen kbladen@usa.net 01/05/1980 326 503-3232
Angela Julie julieee@yahoo.co.uk 11/12/1977 326 323-8888
Bobbi Ferguson bobi123@kiwibox.com 10/02/1970 506 252-9875
Cute Alfa cafa@gmail.com 19/05/1972 506 272-4566

     Back             Next     
 

[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright 2005 -  2018 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 261 visitors are online now