Course Title: DataBase
Date: 03-Feb-2015
SELECT Statement Basics
The SQL SELECT statement queries data from tables in the database. The statement begins with the SELECT keyword. The basic SELECT statement has 3 clauses:
The remainder of this subsection examines the 3 major clauses of the SELECT statement, detailing their syntax and semantics:
SELECT *
FROM EMPLOYEES;
SELECT first_name
FROM EMPLOYEES;
SELECT first_name,last_name
FROM EMPLOYEES;
SELECT first_name,last_name,salary
FROM EMPLOYEES;
SELECT EMPLOYEE_ID,FIRST_NAME, last_name FROM EMPLOYEES;
SELECT last_name,SALARY,SALARY+1000 AS "BOUNS" FROM EMPLOYEES;
SELECT first_name||last_name FROM EMPLOYEES;
SELECT first_name||' '||last_name FROM EMPLOYEES;
SELECT 'The employ id of Mr.' ||first_name||' is '||last_name|| ' is '||EMPLOYEE_ID FROM EMPLOYEES;