Professional Documents
Culture Documents
Class-3-29th May
Class-3-29th May
a) SELECT
b) PROJECTION
c) SELECTION
d) JOINS
a) SELECT:-
*It is a keyword
*It is the process of retrieving or fetching the data from the table and to
display.
b) PROJECTION:-
*It is the process of retrieving or fetching the data from the table by selection
only the column.
c) SELECTION:-
*It is the process of retrieving or fetching the data from the table by selection
both rows and column.
d) JOINS:-
*It is the process of fetching or retrieving the data from multiple tables
symultaniously.
-->PROJECTION:-
*It is the process of retrieving or fetching the data from the table by selection
only the column.
SYNTAX:-(WITH 2-CLAUSES)
SELECT */[DISTINCT],COLUMN_NAME/EXPRESSION,[ALIAS]->ARGUEMENTS
FROM TABLE_NAME;
-->ORDER OF EXECUTION:-
-->FROM CLAUSE:-
-->SELECT CLAUSE:-
*It executes after the execution of FROM CLAUSE.
*In SELECT CLAUSE we can give COL_NAME/EXP as an arguement.
*The job of the SELECT CLAUSE is to go the table which is under execution, and
display the records or COl_NAME/EXP mentioned.
-----------------------------------------------------------------------------------
----
-->ASTRISIKS:-
* It is a star used to display all the records/details from the perticular table.
-->SEMI COLEAN:-
--> DISTINCT:-
*It is a command used to remove the repeated or duplicated values in the result
table.
*DISTINCT is always used as a first arguement in select clause before using any
other column name.
EX:- SELECT DISTINCT JOB,SAL,ENAME..so on
FROM EMP;
-----------------------------------------------------------------------------------
-----
-->EXPRESSION:-
5+3=8-->EXPRESSION
5+3--> statement
8--> is a result
+-->operator
5 & 3 --> operant
a) SELECT *,SAL*12
FROM EMP;
.'. Along with Astrisiks (*), it cannot accept any other column names.
* To overcome this, USE EMP.*, then it accepts any other column names
b) SELECT EMP.*,SAL*12,SAL,JOB..
FROM EMP;
-->ALIAS:-
*It is the alternate name given to the column.
*We can use Alias name without using ALIAS(AS) keyword.
*By 3-ways we can use ALIAS/ALIASING
EX:- SAL*12 as ANNUAL SALARY
a)Without Space-->ANNUALSALARY
b)With Space(BUT WITH DOUBLE COATED)--> "ANNAUL SALARY"
c)With underscore--> ANNUAL_SALARY
EX:-
SELECT EMP.*,SAL*12 ANNUALSAL or "ANNAUL SALARY" or ANNUAL_SALARY
FROM EMP;
-----------------------------------------------------------------------------------
---------------------
-->SELECTION:-
*It is the process of retrieve or fetch the data from the table, by selectiong both
rows and columns.
SYNTAX:-
SELECT COL_NAME/EXP
FROM TABLE_NAME
WHERE FILTER_CONDITION;
-->ORDER OF EXECUTION:-
1ST-FROM CLAUSE
2ND-WHERE CLAUSE
3RD-SELECT CLAUSE
-->WHERE CLAUSE:-
*1.Arithmatic Operator(+,-,/,*)
2.Concatenation Operator (||)
3.Comparission Operator (=,!= or <> )
*4.Relational Operator (<,>,>=,<= )
*5.Logical Operators (AND, OR, NOT )
*6.Special Operator (IN,NOT IN,BETWEEN,NOT BETWEEN,IS,IS NOT,LIKE,NOT LIKE)
7.Sub Query Operator (ALL,ANY,EXISTS,NOT EXISTS)
a) AND OPERATOR:-
*It returns true, if all the conditions are satisfied.
b) OR OPERATOR:-
*It returns true, if any one of the conditions are satisfied.
c) NOT OPERATOR:-
-----------------------------------------------------------------------------------
----------------