PLSQL Session 1
PLSQL Session 1
Notes by Atul Kumar Prajapati - Watch the session on youtube channel for clear understanding
Overview of SQL/PLSQL
✅
SQL : Declarative in Nature
i
at
ap
❌
What to do
aj
How to do
Pr
ar
✅
PL/SQL : Declarative in Nature
m
✅
Ku
What to do
How to do
ul
At
by
Major Topics: ed
ut
1. Function
b
tri
2. Procedure
is
3. Trigger
D
4. Cursor
ly
ee
Fr
Procedure: May/May not return a value = (Name, seat) => ticket + Name +
at
ur
SQL has:
al
on
Queries
rs
Pe
PL/SQL has:
PL/SQL Block/Code
Please do not pay anything for the notes. If you bought it, please report that Scam ID in groups.
Ⓒ
Notes by Atul Kumar Prajapati - Watch the session on youtube channel for clear understanding
Topics in PL/SQL
1. Group By (Optional)
2. Order By
3. WITH Aggregate (Min, Max)
i
at
ap
4. Operations
aj
5. Joins
Pr
6. Constraints (5 types)
ar
m
7. Indexes
Ku
8. Procedure
ul
At
9. Function ( 2 types: Single Row/Multi Row)
by
10. Package
11. Exceptions
ed
ut
12. Views
b
tri
14. Cursor
ly
ee
15. Triggers
Fr
d
an
ed
at
ur
C
ly
al
on
rs
Pe
Please do not pay anything for the notes. If you bought it, please report that Scam ID in groups.
Ⓒ
Notes by Atul Kumar Prajapati - Watch the session on youtube channel for clear understanding
i
at
3. Drop
ap
4. Truncate
aj
Pr
5. Rename
ar
m
2. Data Manipulation Language (DML) - Shuffling with Data
Ku
1. Select
ul
2. Insert
At
3. Update
by
4. Delete ed
ut
b
1. Grant
is
D
2. Revoke
ly
ee
1. Commit
d
an
2. Rollback
ed
3. Savepoint
at
ur
C
ly
Constraints:
al
on
rs
2. Foreign Key -
3. Check
4. Unique -
5. Default - Admitted
6. Not Null - Name
Please do not pay anything for the notes. If you bought it, please report that Scam ID in groups.
Ⓒ
Notes by Atul Kumar Prajapati - Watch the session on youtube channel for clear understanding
PL/SQL Block
Declaration: (Optional)
a int
i
at
program code lines
ap
aj
Pr
Exception Handling: (Optional)
ar
Specific/Generic
m
Ku
End
ul
At
by
ed
ut
Example 1:
b
tri
is
BEGIN
D
ly
Section
Fr
END;
d
an
ed
at
ur
Example 2:
C
ly
al
DECLARE //
on
Declaration Section
rs
Pe
Please do not pay anything for the notes. If you bought it, please report that Scam ID in groups.
Ⓒ
Notes by Atul Kumar Prajapati - Watch the session on youtube channel for clear understanding
Example 3:
DECLARE //
Declaration Section
N1 NUMBER := 5;
N2 NUMBER := 0;
i
at
BEGIN
ap
DBMS_OUTPUT.PUT_LINE(N1/N2); // Body (Executable Code)
aj
Pr
Section
ar
EXCEPTION
m
WHEN ZERO_DIVIDE THEN. // Exception Section
Ku
DBMS_OUTPUT.PUT_LINE(‘Division by zero not allowed’);
ul
END;
At
by
ed
ut
b
tri
is
D
ly
ee
Fr
d
an
ed
at
ur
C
ly
al
on
rs
Pe
Now you can find all lecture notes on: (PLSQL session 5 onwards & others)
Please do not pay anything for the notes. If you bought it, please report that Scam ID in groups.