0% found this document useful (0 votes)
271 views

Oracle 11am

The document provides information about Oracle database and SQL. It discusses that Oracle is a relational database management software used to create and maintain databases in the form of tables. It can store, manipulate, and retrieve data from the database. SQL is the structured query language used to write queries to communicate with the Oracle database and retrieve data. PL/SQL can also be used to interact with Oracle databases and allows writing procedures and functions.

Uploaded by

gavhaned1718
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
271 views

Oracle 11am

The document provides information about Oracle database and SQL. It discusses that Oracle is a relational database management software used to create and maintain databases in the form of tables. It can store, manipulate, and retrieve data from the database. SQL is the structured query language used to write queries to communicate with the Oracle database and retrieve data. PL/SQL can also be used to interact with Oracle databases and allows writing procedures and functions.

Uploaded by

gavhaned1718
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Friday, August 25, 2023 10:04 PM

Notes Link:
Akhil (Admin)
https://bit.ly/oracledbnotes
Mobile: 91541 56192 (Only Whatsapp)
ORACLE installation video link:
https://bit.ly/orainstall

ORACLE (SQL & PL/SQL) @ 11:00 AM (IST) by


Mr.Shiva Chaitanya
Day-1 https://youtu.be/L2TdkaLrgeg
Day-2 https://youtu.be/pcJRloABrYQ

ORACLE 11AM Page 1


Syllabus
Friday, August 25, 2023 11:57 AM

ORACLE
DATABASE
SQL TABLES
PL/SQL ROWS & COLUMNS

SQL:

SQL 5 sub languages & DDL, DRL, TCL, DML, DCL


its commands
Built-In Functions String Functions, Conversion Functions,
aggregate functions …. etc
Clauses SELECT, ORDER BY, DISTINCT, GROUP
BY, HAVING, ….
JOINS Equi, Outer, Non-Equi, Cross, Self joins
Constraints PK, FK, Check, Unique …..
SET OPERATORS UNION, UNION ALL, INTERSECT …
Sub Queries Single row, Multi row, inline view,
correlated …..
VIEWS types of views
INDEXES types of indexes
MATERIALIZED VIEWS
SEQUENCES
SYNONYMS

PL/SQL

ORACLE 11AM Page 2


PL/SQL

PL/SQL Basics Data Types, Declare, Assign, print, read


Control Structures
Cursors
Collections
Exception handling
PROCEDURES
FUNCTIONS
PACKAGES
TRIGGERS
DYNAMIC SQL
Working with LOBs

ORACLE 11AM Page 3


ORACLE
Friday, August 25, 2023 11:16 AM

Database
DBMS
RDBMS
Metadata

Database:

Bank DB College DB

Branches Courses
Customers Students
Transactions Marks
Products Fee
Employee Staff
. Library
.

Database:
• database is a collection of interrelated data in an organized
form.

• Database contains interrelated data. Bank DB contains Bank


related data only. It does not maintain college related data

• Database must be arranged in meaningful format [organized].

ORACLE 11AM Page 4


DBMS:
• DBMS => DataBase Management System / Software

• DBMS is a software that is used to create and maintain


the database.

• DBMS software is used to store business data and analyze


business data.

Evaluation of DBMS:

Before 1960s => in BOOKS

In 1960s => FMS [File Management System]

In 1970s => HDBMS [Hierarchical DBMS]


NDBMS [Network DBMS]

In 1976 => E.F.Codd => RDBMS Concept

ORACLE company founder => Larry Ellison

In 1977 Larry Ellison established a company with the name


"Software Development Laboratories"

In 1979 => first RDBMS software => ORACLE


In 1979 => company name renamed as "Relational Software Inc."

In 1983 => company name renamed as "ORACLE corp"

RDBMS:
• RDBMS => Relational DataBase Management System / Software.

Relation => Table


ORACLE 11AM Page 5
• Relation => Table

• RDBMS is a software that is used to create and maintain the


database in the form of tables.

Examples:
ORACLE SQL SERVER MY SQL DB2 POSTGRE SQL

Example:

CUSTOMER => Table / Relation / Entity 3 columns


2 rows
CID CNAME CCITY
1001 AA HYD
Column / attribute /
1002 BB MUMBAI field / property

row / record / tuple / entity instance

Table is a collection of rows and columns

Row / Record • horizontal representation of data


• is a collection of field values

Column / Field • vertical representation of data


• holds individual values

ORACLE 11AM Page 6


Database => collection of interrelated in an organized

DBMS => is a software => create & maintain the DB

RDBMS => is a software => create & maintain the DB in the


form of tables

Metadata [Data Definition]:


• Metadata is data about the data
• It describes about the data

Examples:
Field names => empid, ename, salary
Table name => EMPLOYEE
data type => NUMBER
field size => NUMBER(4) => 4 is field size

EMPLOYEE

empid ename salary


1001 RAJU 5000
KIRAN => ERROR
7899
9999
10000 => error

empid NUMBER(4) => -9999 to 9999

ORACLE 11AM Page 7


Friday, August 25, 2023 11:55 AM

Bank DB

Customer Table
cid acno cname ccity PAN AADHAR MOBILE MAILID

Transactions Table
T_date_time TID TTYPE AMOUNT Acno

Emp Table
Empno Ename Sal DOJ DOB DOR

ORACLE 11AM Page 8


ORACLE
Saturday, August 26, 2023 11:20 AM

ORACLE:
• is a relational database management software [RDBMS]

• Relation => Table

• ORACLE DB Software is used to create and maintain the


database in the form of tables.

• Using ORACLE, we can store, manipulate and retrieve the


data of database

manipulate => 3 actions [INSERT / UPDATE / DELETE]


Example:
new emp joined INSERT
emp promoted UPDATE
emp resigned DELETE

• retrieve => opening existing data

Example:
check balance
online shopping

• ORACLE DB SOFTWARE 2nd version introduced in 1979.


• 1st version they didn't release to market.

• latest version for WINDOWS OS is: ORACLE 21C


• latest version for LINUX OS is: ORACLE 23C

ORACLE => RDBMS


DATABASE
SQL TABLES
PL/SQL ROWS & COLUMNS

To deal with ORACLE DB, we use 2 Languages. They are:


• SQL
• PL/SQL

ORACLE 11AM Page 9


SQL:
• SQL => Structured Query Language

• SQL is a Query Language.


• It is used to write queries.
• Query is a request that is sent to DB Server.
○ Example: SELECT ename,sal FROM emp; => query
In C:
• Query => request / command / instruction Function:
is a set of statements
• Queries are written to communicate with ORACLE DB
In Java:
• SQL is Non-Procedural Language. It means, we will not Method:
write any set of statements or programs in SQL. Just we is a set of statements
write queries.
In PL/SQL:
• SQL is Unified Language. It means, it is common language Procedure:
to communicate with many Relational databases is a set of statements

ORACLE SQL SERVER MY SQL


DATABASE DATABASE DATABASE
TABLES TABLES TABLES

SQL SQL SQL

• SQL provides built-in functions to make our tasks easier.

• SQL provides commands to write the queries.

SQL sub languages:

SQL provides 5 sub languages. They are:

DDL CREATE
• Data Definition Language ALTER
• Data Definition => metadata
• It mainly deals with metadata DROP
FLASHBACK [ORACLE 10g]
PURGE [ORACLE 10g]

ORACLE 11AM Page 10


PURGE [ORACLE 10g]

TRUNCATE
RENAME

DRL / DQL SELECT


• DRL => Data Retrieval Language
• DQL => Data Query Language
• It deals with data retrievals

TCL COMMIT
• Transaction Control Language ROLLBACK
• It deals with transactions SAVEPOINT

DML: INSERT
• Data Manipulation Language UPDATE
• It deals with data manipulations DELETE

INSERT ALL [ORACLE 9i]


MERGE [ORACLE 9i]

DCL: GRANT
• Data Control Language REVOKE
• It deals with data accessibility

PL/SQL:
• PL/SQL=> Procedural Language / Structured Query Language

• PL/SQL = SQL + Programming

• PL/SQL is extension of SQL.

• It is a Procedural Language. We can write programs or set of


statements.

• All SQL queries can be written as statements in PL/SQL program

ORACLE 11AM Page 11


DDL
Monday, August 28, 2023 11:19 AM

• DDL:
• DDL => Data Definition Language

• Data Definition => metadata

• it deals with metadata

ORACLE SQL provides following DDL commands:


• CREATE
• ALTER

• DROP
• FLASHBACK
• PURGE

• TRUNCATE
• RENAME

ORACLE
CREATE:
DATABASE
• CREATE command is used to create the table.
TABLES
VIEWS
Syntax:
INDEXES
< > Any ORACLE DB Objects
M.VIEWS
CREATE TABLE <table_name> [ ] Optional SEQUENCES
(
SYNONYMS
<field_name> <data_type> [,
<field_name> <data_type>,
PROCEDURES
…………….
FUNCTIONS
……………]
PACKAGES
);
TRIGGERS

Data types in ORACLE SQL:

• Data type tells,


○ how much memory has to be allocated
○ which type of data should be accepted
○ domain [range] of the column

ORACLE SQL provides following data types:

Character Related Char(n)


Varchar2(n)
'RAJU' LONG
'CLERK' CLOB

ORACLE 11AM Page 12


nChar(n)
nVarchar2(n)
nCLOB

Number Related NUMBER(p)

1234 NUMBER(p,s)
6000.00

Date & Time Related DATE


TIMESTAMP
25-DEC-22
28-AUG-23 11:55:0.0 AM

Binary Related BFILE


BLOB
images
audios
videos

Char(n):
• n => max size
• It is used to hold strings [string => a group of chars]
• It is Fixed Length Char Data Type
• max size: 2000 bytes [2000 chars]
• default size: 1
• Examples: statecode, pan_number

Varchar2(n):
• n => max size
• It is used to hold strings [string => a group of chars]
• It is Variable Length Char Data Type
• max size: 4000 bytes [4000 chars]
• default size: no default size
• Examples, ename, job

State_Code CHAR(2) ename VARCHAR2(10)


---------------------- ---------------
TS VIJAY
AP RAJU
UP RAMESH
WB
MH

Note:
Char related data types can accept letters, digits and special
chars

ORACLE 11AM Page 13


VehicleNumber CHAR(10) mail_id VARCHAR2(30)
------------------------ ------------------
TS08AA1234 raju1234@gmail.com
sai@gmail.com

PAN_NUMBER CHAR(10) pname VARCHAR2(20)


------------------- -----------
ABC4D12345 laptop
micro processor

Varchar2(n) data type can hold maximum of 4000 chars.


To hold more than 4000 characters, we can use LONG or CLOB.

LONG:
• It is used to hold large amounts of chars
• max size: 2 GB
• LONG type has some restrictions. They are:
○ we can create only one column as LONG type in a table.
○ we cannot use built-in functions on LONG type.

CLOB:
• CLOB => Character Large Object
• It is used to hold large amounts of chars
• max size: 4 GB
• In one table any number of CLOB columns can be created.
• We can use built-in functions on CLOB type.

Examples:

product_features CLOB

feedback CLOB

comments CLOB

complaints CLOB

experience_summary CLOB

ORACLE 11AM Page 14


Monday, August 28, 2023 12:04 PM

Demo1
F1 CHAR(10) F2 VARCHAR2(10)
10 RAJU6spaces RAJU 4
10 NARESH4spaces NARESH 6
10 SAI7spaces SAI 3

Fixed Length Variable length


Data Type data type

ORACLE 11AM Page 15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy