How to Retrieve Data Using SQL SELECT Statement

Posted by tagicon_admin | July 29, 2015 | in : SQL

Today I will share how to retrieve data by using SQL SELECT statement. Basically SELECT statement are used to identifie  the columns to be displayed. When we want to retrieve or extract data from database table then we use SELECT statement. Now I am showing some example of SQL SELECT statement below:

Syntax of SELECT statement:
====================

SELECT * | {[DISTINCT] column|expression [alias]…..}
FROM table;

–>Example-1: Retrieve all data from employees table by using SELECT statement.

 

–>Example-2: Retrieve last name from employees table by using SELECT statement.

 

–>Example-3: Retrieve first name, employee id, salary  from employees table by using SELECT statement.

 

–>Example-4: Retrieve employee id, first name, salary, (salary + 500) *12  from employees table by using SQL SELECT statement.

 

–>Example-5: Retrieve department id, department name as deptname from departments table by using SQL SELECT statement.

 

–>Example-6: Retrieve first name with add last name from employees table by using SELECT statement

 

–>Example-7: Retrieve unique department id from employees table by using SQL SELECT statement

 

Related Posts

Leave a Reply