CBSE Class 12 Informatics Practices PL SQL

Read and download CBSE Class 12 Informatics Practices PL SQL chapter in NCERT book for Class 12 Informatics Practices. You can download latest NCERT eBooks for 2022 chapter wise in PDF format free from Studiestoday.com. This Informatics Practices textbook for Class 12 is designed by NCERT and is very useful for students. Please also refer to the NCERT solutions for Class 12 Informatics Practices to understand the answers of the exercise questions given at the end of this chapter

Pl Sql Class 12 Informatics Practices NCERT

Class 12 Informatics Practices students should refer to the following NCERT Book chapter Pl Sql in standard 12. This NCERT Book for Grade 12 Informatics Practices will be very useful for exams and help you to score good marks

Pl Sql NCERT Class 12

Chapter – 1

PL/SQL

(Informatics Practices)

PL/SQL = Procedural Language extensions to SQL

An Oracle-specific language combining features of:

  • modern, block-structured programming language
  • database interaction via SQL

Designed to overcome declarative SQL's inability to specify control aspects of DB interaction.

Used to add procedural capabilities to Oracle tools.

PL/SQL is implemented via a PL/SQL engine (cf. JVM)

  • which can be embedded in clients (e.g. Forms, SQL*Plus)
  • which is also usually available in the Oracle server

Why PL/SQL?

Consider trying to implement the following in SQL (SQL*Plus):

If a user attempts to withdraw more funds than they have from their account, then

indicate "Insufficient Funds", otherwise update the account

A possible implementation:

ACCEPT person PROMPT 'Name of account holder: '

ACCEPT amount PROMPT 'How much to withdraw: '

UPDATE Accounts

SET balance = balance - &amount

WHERE holder = '&person' AND balance > &amount;

SELECT 'Insufficient Funds'

FROM Accounts

WHERE holder = '&person' AND balance < = &amount;

Two problems:

  • doesn't express the "business logic" nicely
  • performs both actions when (balance-amount < amount)

We could fix the second problem by reversing the order (SELECT then UPDATE).

But in SQL there's no way to avoid executing both the SELECT and the UPDATE

PL/SQL allows us to specify the control more naturally:

-- A sample PL/SQL procedure

PROCEDURE withdrawal(person IN varchar(20), amount IN REAL ) IS

current REAL;

BEGIN

    SELECT balance INTO current

    FROM Accounts

    WHERE holder = person;

     IF (amount > current)

    dbms_output.put_line('Insufficient Funds');

    ELSE

    UPDATE Accounts

    SET balance = balance - amount

    WHERE holder = person AND balance > amount;

    COMMIT;

    END IF;

END;

And package it up into a useful function, which could be used as:

SQL> EXECUTE withdrawal('John Shepherd', 100.00);


Please refer to attached file for CBSE Classs 12 Informatics Practices PL-SQL

Tags: 

 


Click to View or Download pdf file
Click for more Informatics Practices Study Material

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

MCQ Question based CBSE examination

For 2021-22 CBSE has launched MCQ question-based examination for Term 1 & Term 2 board examinations. The entire syllabus has been divided into two parts each including 50% of the entire syllabus. To score well, students must practice as per the new CBSE term-wise...

CBSE Class 10 Revised Syllabus

Last year CBSE had to reduce the syllabus because of the pandemic situation but it was not very effective because there were no examinations. This year to avoid any confusion and conflict, CBSE has decided to reduce the syllabus into term 1 and term 2. 50 percent of...

Online courses for classes XI and XII offered by NCERT

Ministry of Education (MoE), Government of India has launched a platform for offering Massive Open Online Courses (MOOCs) that is popularly known as SWAYAM (Study Webs of Active learning for Young Aspiring Minds) on 9 th July, 2017. NCERT now offers online courses for...

CBSE OMR Sheet Guidelines for Term 1

You are aware that the CBSE will be using OMR for the first time for assessment of both the Classes-X and XII in Term-I examinations. Hence, there is a need that all the students appearing in the Term-l examinations and the schools sponsoring these students should have...

CBSE Science Challenge 2021 22

Science is inexplicably linked with our lives and helps us to understand the world around us better. Scientific and technological developments contribute to progress and help improve our standards of living. By engaging with this subject, students learn to think, solve...

CBSE notification 40/2021 Innovation Ambassador Program

This is with reference to CBSE Notification No. 40/2021 dated 04.05.2021 regarding the Innovation Ambassador program – An online training program for teachers by CBSE in collaboration with Ministry of Education’s Innovation Cell (MIC) and AICTE. In view of the current...