SQL
1. THIS WAS DEVELOPED BY IBM AND IT IS BASED ON C LANGUAGE.
2. ‘SQL’ STANDS FOR STRUCTURE QUERY LANGUAGE AND IT IS USED BY ALL RDBMS IN THE WORLD LIKE ORACLE,SYSBASE,SQL.SERVER, ACCESS.
3. PARTS OF SQL ARE.
A. DDL :- DATA DEFINATION LANGUAGE(CREATE,ALTER,DROP).
B. DML:- DATA MANUPILATION LANGUAGE. (INSERT,UPDATE,DELETE,SELECT)
C. DCL:- DATA CONTROL LANGAUGE(GRANT,REVOKE).
D. TCL:- TRANSCTION CONTROL LANGUAGE.
\* ALL EXAM IN THIS TUTORIAL ARE REFRENCED TO SCOTT USER
TABLE NAME IS EMP, DEPT.
*/
SELECT STATEMENT.
1. THIS IS USED TO GET THE RECORDS FROM TABLE ON THE BASIS OF SOME ONDITION.
SYNTAX:-
SELECT ,,….
FROM
WHERE
GROUP BY
HAVING
ORDER BY
EXAMAPLE BASED ON EMP AND DEPT TABLE.
DISPLAY DETAILS OF EMPLOYEE WORKING IN DEPTNO 10 OR 20 AND HAVING SAL>200
ANS. SELECT * FROM EMP
WHERE DEPTNO =10 OR DEPTNO 20 AND SAL>200.
2. TO GET ALL COLUM FROM ANY TABLE,WE NEED TO USE THE SYMBOL ‘*’.
3. IF WE DO NOT USE ANY ‘WHERE’ CONDITION THEN ALL THE RECORDS FROM THE TABLE WILL BE SELECTED.
4. WE CAN USE OPERATOR FOR FILTRATION.
5. SOME OF THE OPERATORS IN SQL ARE
A. AIRTHMETIC OPERATOR(+,-,*,/)
B. LOGICAL OPERATOR(AND,OR,NOT)
C. RELATIONAL OPERATOR (<,>,<=,>=)
D. SPECIAL OPERATOR (LIKE,IN,BETWEEN)
LIKE
THIS OPERATOR SEARCHES ON THE BASIS OF WILD CARD CHARS I.E
UNDERSCORE(_) :- CAN REPLACE ONLY ONE CHARATER.
PERCENTAGE(%) :- CAN REPLACE MORE THAN ONE CHARATER.
..TO BE CONTINUED...
..TO BE CONTINUED...
No comments:
Post a Comment