You are on page 1of 3

4.

DATABASE MANAGEMENT SYSTEM - II


at Semester III
(Implemented during Academic Year 2022-23)
(wef 2020-21)

Modules at a Glance

Sr. No. Topics No. of


Lectures

1 Fundamentals of PL/SQL 6

2 Overview of PL/SQL Control Structures 6

3 Stored Procedures 6

4 PL/SQL Records and Collections 6

5 Exception Handling and Cursors 6

Total 30

Course Objectives:
By the end of the course, learners will be able to:
1. Develop efficient PL/SQL programming skills
2. Understanding Oracle database.
3. Designing modular applications using packages.
4. Creating triggers to solve business challenges and enforce business rules.
5. Stepping stone for RDBMS and PL/SQL structures.

Course Outcomes:
After successful completion of this course, learners will be able to:
CO1: Explain the fundamental concepts of PL/SQL. (Understand)
CO2: Develop PL/SQL queries in real-time applications. (Create)
CO3: Design modular applications using packages. (Create)
CO4: Perform PL/SQL programming using concept of Cursor Management, Error
Handling,Package and Triggers (Create)
CO5: Analyze PL/SQL structures like functions, procedures, cursors and triggers for database
applications. (Analyze)

2022-23 Nagindas Khandwala College (Autonomous) 76


Detailed Syllabus:
Module Topics No. of
Lectures
1 Fundamentals of PL/SQL: Introduction, Overview and benefits of 6
PL/SQL, Types of PL/SQL blocks, Simple Anonymous Block, Identifiers,
types of identifiers, Declarative Section, variables, Scalar Data Types, The
% Type attribute, bind variables, sequences in PL/SQL expressions,
Executable statements, comment the code, deployment of SQL functions
in PL/SQL, nested blocks, operators, Invoke SELECT Statements in
PL/SQL, Data Manipulation in the Server using PL/SQL, Save and discard
transactions.
2 Overview of PL/SQL Control Structures: Conditional Control: IF and 6
CASE Statements, IF-THEN Statement, IF-THEN-ELSE Statement,
IFTHEN-ELSIF Statement, CASE Statement, Iterative Control: LOOP
and EXIT Statements, WHILE-LOOP, FOR-LOOP, Sequential Control:
GOTO and NULL Statements.
3 Stored Procedures : Create a Modularized and Layered Subprogram 6
Design, differences between Anonymous Blocks and Subprograms,
Create, Call, and Remove Stored Procedures, Implement Procedures
Parameters and Parameters Modes, View Procedure Information, Stored
Functions and Debugging Subprograms, Create, Call, and Remove a
Stored Function, advantages of using Stored Functions, Invoke User-
Defined Functions in SQL Statements, Packages, advantages of Packages,
components of a Package, Develop a Package, Create the Package
Specification and Body, Invoke the Package constructs.
Triggers: Concept of triggers, implementing triggers - Statement Level
Triggers and Row Level Triggers, Compound Trigger to Resolve the
Mutating Table Error, Comparison of Database Triggers and Stored
Procedures, Create Triggers on DDL Statements.
4 PL/SQL Records: Table-based records, Cursor-based records and User- 6
defined records.
PL/SQL Collection: Index-by tables or Associative array, Nested table,
Variable-size array or Varray.
Exception Handling: Concept of Exception Handling, Handle
Exceptions with PL/SQL, Trap Predefined and non-predefined Oracle
5 Server Errors, User-Defined Exceptions, Propagate Exceptions, 6
RAISE_APPLICATION_ERROR Procedure.
Cursors: Concept of a cursor, types of cursors: implicit cursors; explicit
cursor, Cursor for loops, Cursor variables, parameterized cursors.

2022-23 Nagindas Khandwala College (Autonomous) 77


Reference Books
1. Ivan Bayross, “SQL,PL/SQL -The Programming language of Oracle”, 4th Ed., B.P.B.
Publications, 2009.
2. Murach's Oracle SQL & Pl/SQL Works with All Versions Through 11G.
3. Satish Asnani, Oracle Database 12C Hands-On Sql and Pl/Sql.
4. Oracle 11g: PL/SQL Reference Oracle Press.
5. Dr. P.S.Deshpande SQL &PL/SQL for Oracle 10g Black Book

Practical:
Practical 1: PL/SQL basics
Practical 2: Control Structures
Practical 3: Creating and working with Sequence
Practical 4: Creating Procedures, Functions and Packages
Practical 5: Creating Database Triggers.
Practical 6: Working with Collections
Practical 7: Implementing Records
Practical 8: System and User-defined Exception
Practical 9: Implicit and Explicit Cursors
Practical 10: SQL Server Performance Tuning

Case Study : Car Rental Database


A car rental company has several car rental agencies across the country. The agencies rent
several classes of vehicles: compact, midsize, full size, sport utility. Each vehicle is manager
by one agency. Customers rent vehicles from different agencies. When a vehicle is rented, a
new rental record is added to Rental table with Dateout as the current dateand DateReturned is
left Null. When the vehicle is returned, the record is updated filling in the DateReturned field.
A portion of the car rental database schema is as follows:
Vehicle (Vehicleid, Vehicleclassid, Agencyid)
Rental(Rentalid, Vehicleid, Customerid, Dateout, DateReuturned) Customer(Customerid,
CustomerName, CustomerBalance) Agency(Agencyid, AgencyLocation)
VehicleClass(VehicleClassid, VehicleClassName, RentalRate)
a) Create sequence for generating primary key value prefixed with entity starting variable.
For example, to generate Vehicleid it must be in the format “V1” and so on.
b) Implement trigger to store the record in Rental table whenever a vehicle is rented.
c) Create a procedure to insert, update and delete records in individual table.
d) Create a function to display total cars rented by the customer.

2022-23 Nagindas Khandwala College (Autonomous) 78

You might also like