Email Us : sunilkumark11@gmail.com
Free Training > SQL PL/ SQL Forms Reports Oracle Applications
< Previous Next >

 
SQL Introduction
SQL:
Stands for Structured Query language. It is pronunced as Sequel.
This language is used to communicate to Oracle Database.
This languaged is developed in the year 1972 by IBM.
             
Features of SQL:
1) It is a command based language
2) This language is similar to English
3) Every command should end with;
4) Commands are not case sesitive.
Sub Languages:

SQL is divided in 5 sub languages

1) DDL ( Data Definition Language )
2) DML ( Data Manipultation Language)
3) DRL / DQL ( Data Retrieval Language / Data Query Language )
4) TCL ( Transaction Control Language )
5) DCL ( Data Control Language )

Commands of SQL:

1) DDL ( Data Definition Language ) :
----------------------------------------------

This language is used to create and manage database objects.

Commands of DDL are 1) Create 2) Alter 3) Drop 4) Truncate and 5) Rename

2) DML ( Data Manipulation Language )
-------------------------------------------------
This language is used to manage data present in the table

Commands of DML are 1) Insert, 2) Update , 3) Delete and 4) Merge

3) DRL ( Data Retrieval Language )
----------------------------------------------
This language is used to retrive the data from the table.

It is only one command ie 1) Select.

4) TCL ( Transaction control Language )
-----------------------------------------------------
This language is used to maintain transactions of the database.
It is collection of three comands 1) Commit, 2) Rollback and 3)Savepoint

5) DCL ( Data Control Language )
--------------------------------------------
It is used to control the data and maintain security.
It is collection of two commands Grant and Revoke

SQL *Plus:

It is environment which used to write the queries and submit the queries for execution.

To connect to the database
SQL> Conn
username - scott
password - tiger
Connected.
   

Table:
----------------
Table is an object which is used to store the data into the database.
It is collection of rows and columns.     
Datatypes:
----------------
The following are the datatypes which are used in Oracle   

1) Char(size):
---------------------
Used to store alphanumeric values. This datatype is of fixed length.
Maximum size 2000 bytes.

2) Varchar2 (size):
------------------------
Used to store aplhanumeric values. This datatype is of variable length.
Maximum size 4000 bytes.

3) Number(p,s):
----------------------
Used to store number values.
P -stands for precision
S -stands for scale

Maximum size , precision or scale can range from 1 to 38

4) Date:
-----------
Used to store date values.
Range 01-jan-4712 BC to 31-dec-9999 AD

5) CLOB:
--------------
Used to store alphanumeric values.
maxsize - 4 GB

6) BLOB:
------------
Used to store binary data
Maxsize - 4GB

7) Bfile:
--------------
Used to store binary files.

Maxsize - 4 GB if internal to the database.
A file > 4 GB is stored external to the database at OS level.


< Previous Next >