Oracle Database
=================
Q)Types of data?
We have two types of data.
1)Unstructured data
2)Structured data
1)Unstructured data
--------------------
Data which is not in readable format is called unstructured data.
In general, meaningless data is called unstructured data.
ex:
201 willeroo Lakemba SYD NSW
2)Structured data
-----------------
Data which is in readable format is called structured data.
In general, meaningfull data is called structured data.
ex:
unit Street Locality city state
----- ------- -------- ---- -----
201 willeroo Lakemba SYD NSW
Oracle
========
Oracle is one of the database which is used to store structured data.
Oracle is a product of Oracle Corporation.
Oracle is classified into two types.
Oracle
|
|--------------------------------------------------|
SQL PL/SQL
(Structured Query Language) (Procedural/Structured Query Lang)
Client/Server Architecture
===========================
In this architecture we will understand how our data will store from frontend to
backend.
Diagram: oracle1.1
FrontEnd
----------
The one which is visible to the enduser to perform some operations is called
frontend.
ex:
Java,.Net,Python,Perl,D2k and etc.
Communication Channel
-------------------
It acts like a bridge between frontend and backend.
ex:
JDBC- Java Database Connectivity.
ODBC- Open Database Connectivity.
PDBC- Python Database Connectivity.
BackEnd
---------
The one which is not visible to the enduser but it performs some operations based
on the instructions given by frontend is called backend.
ex:
Oracle, MySQL, Teradata, MongoDB,NoSQL and etc.
Management System
=================
Management system is a software which is used to manage the database.
Management system will perform following activities very easily.
1) Adding the new data
2) Modifying the existing data
3) Deleting the unnecessary data
4) Selecting the required data
DBMS
=====
A database along with software which is used to manage the database is called
Database Management System.
RDBMS
======
If database is created based on relational theories is called relational database
management system.
ex:
Oracle, MySQL, PostgreSQL, SQL Server , Teredata and etc.
SQL
========
SQL stands for Structured Query Language which pronounce as SEQUEL.
It is used to communicate with oracle database.
It is a case insensitive language.
It is a command based language.
Every command must starts with verbs.
ex:
insert,update,delete,merge and etc.
Every command must and should ends with semicolon(;).
It is a language developed by Mr.Codd(by IBM) in 1972.
Sub Languages of SQL
===================
We have five sub languages of SQL.
1) DDL (Data Definition Language)
2) DML (Data Manipulation Language)
3) DRL/DQL (Data Retrieval/Query Language)
4) TCL (Transaction Control Language)
5) DCL (Data Control Language)
1) DDL (Data Definition Language)
-----------------------------------
This language is used to manage the objects in database.
It is a collection of five commands.
ex:
create,alter,drop,truncate and rename.
2) DML (Data Manipulation Language)
-------------------------------
This language is used to manipulate the data present in database.
It is a collection of four commands.
ex:
insert,update,delete and merge.
3) DRL/DQL (Data Retrieval/Query Language)
-----------------------------------------
This language is used to retrieve the data present in database.
It is a collection of one command.
ex:
select
4) TCL (Transaction Control Language)
----------------------------------
This language is used to maintain the transaction of databases.
It is a collection of three commands.
ex:
commit,rollback and savepoint.
5) DCL (Data Control Language)
-------------------------------
This language is control the access of data for the user.
It is a collection of two commands.
ex:
grant and revoke.
Table
======
Table is used to represent the data in the form rows and columns.
Table is a collection of rows and columns.
ex:
SNO SNAME SADD
-------------------------
101 raja hyd
--------------------------
102 ravi delhi
--------------------------
103 ramana vizag
--------------------------
Here we have three rows and three columns.
Oracle is a case insensitive language.
But the data which is present in table is a case sensitive.
Oracle
========
Version : 10g or 11g
Vendor : Oracle Corporation
Creator : Mr. Codd
Open Source : Open Source
Edition : Express Edition
website : www.oracle.com/in/database/
username : system (default)
password : admin (custom)
Download link :
https://drive.google.com/file/d/0B9rC21sL6v0td1NDZXpkUy1oMm8/view?
usp=share_link&resourcekey=0-aKooR3NmAh_eLo_qGw_inA
Establish the connection with database software
================================================
To execute any query in database or operation we need to establish the connection
with database software.
Once the work with database is completed then we need to disconnect with database
software.
ex:1
-----
SQL> connect
username : system
password : admin
SQL> disconnect
ex:2
-----
SQL> conn
username : system
password : admin
SQL> disc
ex:3
-----
SQL> conn system/admin
SQL> disc
create command
------------------
A create command is used to create a table in a database.
syntax:
create table table_name(col1 datatype(size),
col2 datatype(size),
...,
colN datatype(size));
ex:
----
create table student(sno number(3),sname varchar2(10),
sadd varchar2(12));