Professional Documents
Culture Documents
Akhil (Admin)
Notes Link:
Mobile: 91541 56192 (Whatsapp Only)
https://bit.ly/oracledbnotes
Bank DB
Customer
CID CNAME AADHAR PAN MOBILE
Transactions
Tid T_date_time tType amount Acno
Staff
Empno Ename Sal Job
Data Store:
• the location where data is stored is called
"Data Store".
File:
• is a kind of data store.
• It is suitable for single user only.
• It is suitable to store small amounts of data.
• No Security.
Database:
• is a kind of data store.
• It is suitable for multiple users
• It is suitable to store large amounts of data.
• Security will be there.
BANK DB COLLEGE DB
Branches Courses
Customers Students
Transactions Marks
Products Fee
Staff Staff
DBMS:
• DBMS => DataBase Management System / Software.
Evolution of DBMS:
RDBMS:
• It is a kind of DBMS.
• Examples:
ORACLE, SQL SERVER, DB2, MY SQL, Postgre SQL
TABLE:
Metadata:
• Metadata can be also called "Data Definition".
• Metadata is the data about the data.
Examples:
Field Name => empno, ename, sal
Table Name => EMPLOYEE
Data type => NUMBER
Field Size => VARCHAR2(10) => 10 is field size
EMPLOYEE
ORACLE:
• ORACLE is a Relational DataBase management
Software [RDBMS].
• Relation => table
Check balance
Transaction Statement
Online shopping => searching for products
Founder of ORACLE => Larry Ellison
• ORACLE software 2nd version released in 1979. 1979 Relational Software Inc. => ORACLE s/w introduced
They didn't release 1st version. 1983 ORACLE
• Latest Version:
For Windows OS ORACLE 21C
For LINUX OS ORACLE 23C
PL/SQL:
• PL => Procedural Language
• SQL => Structured Query Language
SYLLABUS
SQL
CLAUSES SELECT
FROM
WHERE
ORDER BY
DISTINCT
GROUP BY
HAVING
OFFSET
FETCH
INDEXES
SEQUENCES
SYNONYMS
PL/SQL
PL/SQL Basics Data Types
Declare
Assign
Print
Read
Using SQL commands in PL/SQL
Control Structures
Cursors
Collections
Exception Handling
STORED PROCEDURES
STORED FUNCTIONS
PACKAGES
TRIGGERS
Working with LOBs
Dynamic SQL
DDL: CREATE
• Data Definition Language
• Data Definition => Metadata ALTER
• It deals with metadata
DROP
FLASHBACK [ORACLE 10g]
PURGE [ORACLE 10g]
TRUNCATE
RENAME
TCL: COMMIT
• Transaction Control Language ROLLBACK
SAVEPOINT
• It deals with transactions
DML: INSERT
• Data manipulation Language UPDATE
DELETE
• Manipulate => 3 actions
INSERT / UPDATE / DELETE INSERT ALL [ORACLE 9i]
MERGE [ORACLE 9i]
It deals with data manipulations
Table
CREATE View
Index
Sequence
Synonym
Materialized View
PROCEDURE
FUNCTION
TRIGGER
PACKAGE
CREATE
EMPLOYEE
EMPNO NUMBER(4) ENAME VARCHAR2(10) SAL MAIL_ID MOBILE
RECYCLEBIN
DROP => employee
employee
ORACLE 730PM Page 15
RECYCLEBIN
DROP => employee
employee
TRUNCATE
EMPLOYEE TABLE
EMPNO ENAME SAL STRUCTURE
1001 ..
1002 .. +
..
DATA
1100
EMP
DML => EMPNO ENAME JOB SAL
1001 AA CLERK 5000
INSERT 1002 BB MANAGER 8000
UPDATE
1003 CC SALESMAN 7000
DELETE
Commit COMMIT;
Rollback
Savepoint
USER: userB
DDL:
• Data Definition Language
• Data Definition => Metadata
• It mainly deals with metadata
CREATE:
• It is used to create the tables.
<> Any
Syntax to create the table: [ ] Optional
Data Type:
nChar(n)
nVarchar2(n)
nCLOB
NUMBER(p):
• p => precision => max no of digits.
• p valid range: 1 to 38
Examples:
Sub1_Marks NUMBER(3)
Range: -999 TO 999
--------------------
67
89
100
123
999
1000 => ERROR
Mobile_Number NUMBER(10)
Aadhar_Number NUMBER(12)
Credit_Card_number NUMBER(16)
NUMBER(p,s):
• p => precision
• s => scale