SlideShare a Scribd company logo
Introduction to Database
www.collaborationtech.co.in
Bengaluru INDIA
Presentation By
Ramananda M.S Rao
Content
Content
Overview
Database Concepts
Database Fundamentals
Introduction to Database Management Systems
Different Models
Three Layer Architecture
Data Independence,
DDL, DML, DCL, Functions of DBA, DBM
Introduction to ORACLE technology stack
SQL Language
Introduction & Using SQL*Plus
SQL History and Standards, SQL Basics
SQL Data Types
Writing Basic SQL statements
Creating and Managing Tables
Insert, Update, Delete commands
Alter, Drop commands
Select Command
Constraints
www.collaborationtech.co.in
Content
SQL Operators and Functions
Single row functions
Aggregating data using group functions
Group By clause
Set Operators
Joins
Creating Views
Subquery
Nested Queries
Co-related Sub-queries
Controlling user access
Grant and Revoke Statements
Optimization and Performance
SQL Tuning
www.collaborationtech.co.in
Content
ER Model
Assignments on E-R Model
E-R to Relational Mapping
Assignments on E-R to Relational Mapping
Normalization
Assignments on Normalization
Using simple modeling Tool
Building model for Simple Applications
Simple Fund Management example
Simple Inventory example
Simple Security example
PL/SQL Programming
PL/SQL Variables and Constants
Using %TYPE and %ROWTYPE Attributes
PL/SQL Variable Scope
Creating Anonymous PL/SQL Block
Using DBMS_OUTPUT.PUT_LINE
PL/SQL Control Structures and Variables
Writing Interactive PL/SQL program
Embedding SELECT Statement inside PL/SQL Block,
Embedding DML Statements inside PL/SQL Block
www.collaborationtech.co.in
Content
Cursors and Exceptions
Cursors - Definition Cursor
Using Implicit and Explicit Cursors
Cursor Attributes, Cursor FOR loops, Parameterized Cursors
FOR UPDATE and WHERE CURRENT OF with Explicit Cursors
Exception Definition
Handling user defined,
Oracle predefined and non-predefined exceptions.
Propagating exceptions
Procedures , functions and Triggers
Creating Stored Procedures and functions
Invoking stored procedures
Parameter Modes – IN, OUT and IN OUT
Calling Stored Functions
Packages
Definition Packages
Advantages of using Packages
Components of a Package
Creating and using Package
www.collaborationtech.co.in
Content
Triggers - Definition Triggers
Database Triggers
Difference between Stored Procedure and Database Triggers
Trigger Components and types
Creating and using Database Triggers
Objects In database
Objects Types and Using Object Table
Creating and Using Collection Types
Dynamic SQL
Native Dynamic SQL
Using Packages like DBMS_OUTPUT, DBMS_PIPE, UTL_FILE,
DBMS_SQL
Bulk statements in PL/SQL
Creating Indexes
www.collaborationtech.co.in
Overview
 SQL stands for Structured Query Language.
 SQL is used to communicate with a database.
 SQL statements are used to perform tasks such as update
data on a database, or retrieve data from a database.
 SQL commands are divided into several different types,
among them data manipulation language (DML) and data
definition language (DDL) statements, transaction
controls and security measures.
 The DML vocabulary is used to retrieve and manipulate
data.
 DDL statements are for defining and modifying database
structures.
www.collaborationtech.co.in
Overview
 PL/SQL is an Oracle procedural extension for SQL. They
have designed this language for easy use of complex SQL
statements.
 PL SQL basically stands for "Procedural Language
extensions to SQL".
 It combines the data manipulation power of SQL with the
processing power of procedural language to create a
super powerful SQL queries.
 Similar to other database languages, it gives more control
to the programmers by the use of loops, conditions and
object oriented concepts.
www.collaborationtech.co.in
SQL
SQL> create database student
SQL>show database
SQL>create table employee
(id int(11),ename varchar(45),address varchar(45),
Dob date);
SQL>insert into employee values(1,’raj’,’vijayanagar
bengaluru’,’02-02-2017’);
SQL>desc employee
SQL>select * from employee
SQL> update employee set ename=‘Sunilkumar' where
id=1;
SQL>DELETE FROM employee WHERE id=1;
www.collaborationtech.co.in
SQL
SQL>create table student
(id int(11),sname varchar(45),address varchar(45),Dob date,age int(11));
SQL>insert into employee values(1,’kumar’,’vijayanagar mysore’,’01-02-2017’,20);
SQL>insert into employee values(2,’sunil’,’vijayanagar bangalore’,’05-02-2017’,25);
SQL>desc student
SQL>select * from student
SQL> update student set ename=‘Anilkumar' where id=2;
SQL>DELETE FROM student WHERE id=1;
SQL>create table customer
(id int(11),cname varchar(45),address varchar(45),mno varchar(45));
SQL>insert into customer values(1,’chetan’,’btm bangalore’,’9865324175’);
SQL>insert into customer values(2,guru’,’rpc layout bangalore’,’9586231475’);
SQL>desc customer
SQL>select * from customer
SQL> update customer set ename=‘Vishal' where id=2;
SQL>DELETE FROM customer WHERE id=1;
Alter Command
ALTER TABLE customer ADD Gender char(1);
ALTER TABLE customer MODIFY Location char(100);
www.collaborationtech.co.in
PL/SQL
BEGIN
dbms_output.put_line(‘Hello World..’);
END;

Declaring and usage of variables in program
DECLARE
text VARCHAR2(45);
BEGIN
text:= ‘Hello World’;
dbms_output.put_line(text);
END;

www.collaborationtech.co.in
Ratio
declare
numerator number;denominator number;
the_ratio number;
lower_limit constant number:=0.72;
samp_num constant number:=132;
BEGIN
SELECT X, Y INTO numerator, denominator from result_table where sample_id = samp_num;
the_ratio := numerator/denominator;
if the_ratio > lower_limit then
insert into ratio values(samp_num, the_ratio);
ELSE
Insert into ratio values (samp_num,-1);
END IF;commit;
exception
when zero_divide then
insert into ratio values(samp_num,0);
commit;when others then rollback; end;
www.collaborationtech.co.in
Wages
CREATE FUNCTION dept-sal (dnum NUMBER) RETURN NUMBER IS CURSOR
emp-cursor ISo
SELECT sal, comm FROM emp WHERE deptno = dnum;
total-wages NUMBER(,(:=0;
cnt NUMBER(10) :=1;
BEGIN
FOR emp-record IN emp-cursor LOOP
emp-record.comm := NVL (emp-record.comm, 0);
total-wages := total-wages + emp.record, sal+emp-record-comm;
PUT-LINE (LOOP number = '|| cnt ||', 'wages ='|| TO-CHAR (total-wages));
cnt := cnt+1;
ENDLOOP:
/* Debug Line */
PUT-LINE (Total wages ='|| TO-CHAR (total-wages));
RETURN total-wages;
END dept-sal:
www.collaborationtech.co.in
Procedures and Functions in PL/SQL
Procedure is a subprogram unit that consists of a group of PL/SQL
statements.Procedure can have a RETURN tatement to return the control to
the calling block, but it cannot return any values through the RETURN
statement.
CREATE OR REPLACE PROCEDURE welcome_msg(p_name IN
VARCHAR2)
IS
BEGIN
Dbms_output.put_line(‘Welcome’||p_name);
END

EXEC welcome_msg(‘Collaboration Technologies’);
www.collaborationtech.co.in
Follow us on Social
Facebook: https://www.facebook.com/collaborationtechnologies/
Twitter : https://twitter.com/collaboration09
Google Plus : https://plus.google.com/100704494006819853579
LinkedIn : https://www.linkedin.com/in/ramananda-rao-a2012545
Instagram : https://instagram.com/collaborationtechnologies
YouTube :
https://www.youtube.com/channel/UCm9nK56LRbWSqcYWbzs8CUg
Skype : facebook:ramananda.rao.7
WhatsApp : +91 9886272445
www.collaborationtech.co.in
THANK YOU
About Us

More Related Content

What's hot

TID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseTID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseWanBK Leo
 
Database introduction
Database introductionDatabase introduction
Database introduction
Harry Potter
 
Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)
Naman Joshi
 
Dbms and sqlpptx
Dbms and sqlpptxDbms and sqlpptx
Dbms and sqlpptx
thesupermanreturns
 
Dbms Concepts
Dbms ConceptsDbms Concepts
Dbms Conceptsadukkas
 
Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1
Junaid Nadeem
 
dbms intro
  dbms intro  dbms intro
dbms intro
Pooja Pathak
 
Dbms basics 02
Dbms basics 02Dbms basics 02
Dbms basics 02
Jaipal Dhobale
 
Relational database revised
Relational database revisedRelational database revised
Relational database revisedmnodalo
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Usman Tariq
 
Database management system
Database management system   Database management system
Database management system
9535814851
 
Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database Design
Sondra Willhite
 
dbms
dbmsdbms
Mydbms
MydbmsMydbms
introduction to database
 introduction to database introduction to database
introduction to database
Akif shexi
 
Data base management systems ppt
Data base management systems pptData base management systems ppt
Data base management systems ppt
suthi
 
Database management system
Database management systemDatabase management system
Database management system
Sayed Ahmed
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Dipen Parmar
 

What's hot (20)

TID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseTID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To Database
 
Database introduction
Database introductionDatabase introduction
Database introduction
 
Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)
 
Lec01
Lec01Lec01
Lec01
 
Dbms and sqlpptx
Dbms and sqlpptxDbms and sqlpptx
Dbms and sqlpptx
 
Dbms Concepts
Dbms ConceptsDbms Concepts
Dbms Concepts
 
Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1
 
dbms intro
  dbms intro  dbms intro
dbms intro
 
Dbms basics 02
Dbms basics 02Dbms basics 02
Dbms basics 02
 
Relational database revised
Relational database revisedRelational database revised
Relational database revised
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
 
Database management system
Database management system   Database management system
Database management system
 
Intro to Database Design
Intro to Database DesignIntro to Database Design
Intro to Database Design
 
dbms
dbmsdbms
dbms
 
Mydbms
MydbmsMydbms
Mydbms
 
Dbms unit01
Dbms unit01Dbms unit01
Dbms unit01
 
introduction to database
 introduction to database introduction to database
introduction to database
 
Data base management systems ppt
Data base management systems pptData base management systems ppt
Data base management systems ppt
 
Database management system
Database management systemDatabase management system
Database management system
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
 

Viewers also liked

Database an introduction
Database an introductionDatabase an introduction
Database an introduction
Anwarul Islam, PhD
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)
Vidyasagar Mundroy
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
mohdoracle
 
Software Testing Basics
Software Testing BasicsSoftware Testing Basics
Software Testing Basics
Belal Raslan
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
 
Oxford Scholarship Online Access
Oxford Scholarship Online AccessOxford Scholarship Online Access
Oxford Scholarship Online Access
Anwarul Islam, PhD
 
Software Engineering - 01. Introduction
Software Engineering - 01. IntroductionSoftware Engineering - 01. Introduction
Software Engineering - 01. Introduction
Arry Arman
 
Software Engineering - Introduction and Motivation (Marcello Thiry)
Software Engineering - Introduction and Motivation (Marcello Thiry)Software Engineering - Introduction and Motivation (Marcello Thiry)
Software Engineering - Introduction and Motivation (Marcello Thiry)
Marcello Thiry
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
Eddyzulham Mahluzydde
 
C# programming language
C# programming languageC# programming language
C# programming language
swarnapatil
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1
Eddyzulham Mahluzydde
 
Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2
Eddyzulham Mahluzydde
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
Eddyzulham Mahluzydde
 
Chapter 3 Entity Relationship Model
Chapter 3 Entity Relationship ModelChapter 3 Entity Relationship Model
Chapter 3 Entity Relationship Model
Eddyzulham Mahluzydde
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Chia-Chi Chang
 
Java OOP Programming language (Part 1) - Introduction to Java
Java OOP Programming language (Part 1) - Introduction to JavaJava OOP Programming language (Part 1) - Introduction to Java
Java OOP Programming language (Part 1) - Introduction to Java
OUM SAOKOSAL
 
Introduction to Advanced Javascript
Introduction to Advanced JavascriptIntroduction to Advanced Javascript
Introduction to Advanced Javascript
Collaboration Technologies
 
Meetup Python Nantes - les tests en python
Meetup Python Nantes - les tests en pythonMeetup Python Nantes - les tests en python
Meetup Python Nantes - les tests en python
Arthur Lutz
 
Python - Lecture 1
Python - Lecture 1Python - Lecture 1
Python - Lecture 1
Ravi Kiran Khareedi
 

Viewers also liked (20)

Database an introduction
Database an introductionDatabase an introduction
Database an introduction
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
 
Software Testing Basics
Software Testing BasicsSoftware Testing Basics
Software Testing Basics
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
Oxford Scholarship Online Access
Oxford Scholarship Online AccessOxford Scholarship Online Access
Oxford Scholarship Online Access
 
Software Engineering - 01. Introduction
Software Engineering - 01. IntroductionSoftware Engineering - 01. Introduction
Software Engineering - 01. Introduction
 
Software Engineering - Introduction and Motivation (Marcello Thiry)
Software Engineering - Introduction and Motivation (Marcello Thiry)Software Engineering - Introduction and Motivation (Marcello Thiry)
Software Engineering - Introduction and Motivation (Marcello Thiry)
 
Sql Overview
Sql OverviewSql Overview
Sql Overview
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
 
C# programming language
C# programming languageC# programming language
C# programming language
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1
 
Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
Chapter 3 Entity Relationship Model
Chapter 3 Entity Relationship ModelChapter 3 Entity Relationship Model
Chapter 3 Entity Relationship Model
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
 
Java OOP Programming language (Part 1) - Introduction to Java
Java OOP Programming language (Part 1) - Introduction to JavaJava OOP Programming language (Part 1) - Introduction to Java
Java OOP Programming language (Part 1) - Introduction to Java
 
Introduction to Advanced Javascript
Introduction to Advanced JavascriptIntroduction to Advanced Javascript
Introduction to Advanced Javascript
 
Meetup Python Nantes - les tests en python
Meetup Python Nantes - les tests en pythonMeetup Python Nantes - les tests en python
Meetup Python Nantes - les tests en python
 
Python - Lecture 1
Python - Lecture 1Python - Lecture 1
Python - Lecture 1
 

Similar to Introduction to Database SQL & PL/SQL

Introduction to the Structured Query Language SQL
Introduction to the Structured Query Language SQLIntroduction to the Structured Query Language SQL
Introduction to the Structured Query Language SQL
Harmony Kwawu
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
Sqlperfomance
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
CPD INDIA
 
SQL Training courses.pptx
SQL Training courses.pptxSQL Training courses.pptx
SQL Training courses.pptx
irfanakram32
 
Sql
SqlSql
Querying microsoft sql server 2012
Querying microsoft sql server 2012Querying microsoft sql server 2012
Querying microsoft sql server 2012
sasikalaD3
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
FaisalGhffar
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
Achmad Solichin
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
Achmad Solichin
 
Intro
IntroIntro
Dbms & prog lang
Dbms & prog langDbms & prog lang
Dbms & prog langTech_MX
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hydewebhostingguy
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developerswebhostingguy
 
sql ppt.pptx
sql ppt.pptxsql ppt.pptx
sql ppt.pptx
ArunT58
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
shamim hossain
 

Similar to Introduction to Database SQL & PL/SQL (20)

Introduction to the Structured Query Language SQL
Introduction to the Structured Query Language SQLIntroduction to the Structured Query Language SQL
Introduction to the Structured Query Language SQL
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
 
Sql server
Sql serverSql server
Sql server
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
lovely
lovelylovely
lovely
 
SQL Training courses.pptx
SQL Training courses.pptxSQL Training courses.pptx
SQL Training courses.pptx
 
Sql
SqlSql
Sql
 
Querying microsoft sql server 2012
Querying microsoft sql server 2012Querying microsoft sql server 2012
Querying microsoft sql server 2012
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
SQL overview and software
SQL overview and softwareSQL overview and software
SQL overview and software
 
Module02
Module02Module02
Module02
 
Shrikanth
ShrikanthShrikanth
Shrikanth
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Intro
IntroIntro
Intro
 
Dbms & prog lang
Dbms & prog langDbms & prog lang
Dbms & prog lang
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
 
sql ppt.pptx
sql ppt.pptxsql ppt.pptx
sql ppt.pptx
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
 

More from Collaboration Technologies

Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
Collaboration Technologies
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Collaboration Technologies
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
Collaboration Technologies
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
Collaboration Technologies
 
Introduction to HTML4
Introduction to HTML4Introduction to HTML4
Introduction to HTML4
Collaboration Technologies
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Collaboration Technologies
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
Collaboration Technologies
 
Introduction to JPA Framework
Introduction to JPA FrameworkIntroduction to JPA Framework
Introduction to JPA Framework
Collaboration Technologies
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Collaboration Technologies
 
Introduction to Perl Programming
Introduction to Perl ProgrammingIntroduction to Perl Programming
Introduction to Perl Programming
Collaboration Technologies
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Collaboration Technologies
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
Collaboration Technologies
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Collaboration Technologies
 
Introduction to Struts 2
Introduction to Struts 2Introduction to Struts 2
Introduction to Struts 2
Collaboration Technologies
 
Introduction to JSON & AJAX
Introduction to JSON & AJAXIntroduction to JSON & AJAX
Introduction to JSON & AJAX
Collaboration Technologies
 
Introduction to Node.JS
Introduction to Node.JSIntroduction to Node.JS
Introduction to Node.JS
Collaboration Technologies
 

More from Collaboration Technologies (16)

Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Introduction to HTML4
Introduction to HTML4Introduction to HTML4
Introduction to HTML4
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
Introduction to JPA Framework
Introduction to JPA FrameworkIntroduction to JPA Framework
Introduction to JPA Framework
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Introduction to Perl Programming
Introduction to Perl ProgrammingIntroduction to Perl Programming
Introduction to Perl Programming
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Introduction to Struts 2
Introduction to Struts 2Introduction to Struts 2
Introduction to Struts 2
 
Introduction to JSON & AJAX
Introduction to JSON & AJAXIntroduction to JSON & AJAX
Introduction to JSON & AJAX
 
Introduction to Node.JS
Introduction to Node.JSIntroduction to Node.JS
Introduction to Node.JS
 

Recently uploaded

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 

Introduction to Database SQL & PL/SQL

  • 1. Introduction to Database www.collaborationtech.co.in Bengaluru INDIA Presentation By Ramananda M.S Rao
  • 2. Content Content Overview Database Concepts Database Fundamentals Introduction to Database Management Systems Different Models Three Layer Architecture Data Independence, DDL, DML, DCL, Functions of DBA, DBM Introduction to ORACLE technology stack SQL Language Introduction & Using SQL*Plus SQL History and Standards, SQL Basics SQL Data Types Writing Basic SQL statements Creating and Managing Tables Insert, Update, Delete commands Alter, Drop commands Select Command Constraints www.collaborationtech.co.in
  • 3. Content SQL Operators and Functions Single row functions Aggregating data using group functions Group By clause Set Operators Joins Creating Views Subquery Nested Queries Co-related Sub-queries Controlling user access Grant and Revoke Statements Optimization and Performance SQL Tuning www.collaborationtech.co.in
  • 4. Content ER Model Assignments on E-R Model E-R to Relational Mapping Assignments on E-R to Relational Mapping Normalization Assignments on Normalization Using simple modeling Tool Building model for Simple Applications Simple Fund Management example Simple Inventory example Simple Security example PL/SQL Programming PL/SQL Variables and Constants Using %TYPE and %ROWTYPE Attributes PL/SQL Variable Scope Creating Anonymous PL/SQL Block Using DBMS_OUTPUT.PUT_LINE PL/SQL Control Structures and Variables Writing Interactive PL/SQL program Embedding SELECT Statement inside PL/SQL Block, Embedding DML Statements inside PL/SQL Block www.collaborationtech.co.in
  • 5. Content Cursors and Exceptions Cursors - Definition Cursor Using Implicit and Explicit Cursors Cursor Attributes, Cursor FOR loops, Parameterized Cursors FOR UPDATE and WHERE CURRENT OF with Explicit Cursors Exception Definition Handling user defined, Oracle predefined and non-predefined exceptions. Propagating exceptions Procedures , functions and Triggers Creating Stored Procedures and functions Invoking stored procedures Parameter Modes – IN, OUT and IN OUT Calling Stored Functions Packages Definition Packages Advantages of using Packages Components of a Package Creating and using Package www.collaborationtech.co.in
  • 6. Content Triggers - Definition Triggers Database Triggers Difference between Stored Procedure and Database Triggers Trigger Components and types Creating and using Database Triggers Objects In database Objects Types and Using Object Table Creating and Using Collection Types Dynamic SQL Native Dynamic SQL Using Packages like DBMS_OUTPUT, DBMS_PIPE, UTL_FILE, DBMS_SQL Bulk statements in PL/SQL Creating Indexes www.collaborationtech.co.in
  • 7. Overview  SQL stands for Structured Query Language.  SQL is used to communicate with a database.  SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database.  SQL commands are divided into several different types, among them data manipulation language (DML) and data definition language (DDL) statements, transaction controls and security measures.  The DML vocabulary is used to retrieve and manipulate data.  DDL statements are for defining and modifying database structures. www.collaborationtech.co.in
  • 8. Overview  PL/SQL is an Oracle procedural extension for SQL. They have designed this language for easy use of complex SQL statements.  PL SQL basically stands for "Procedural Language extensions to SQL".  It combines the data manipulation power of SQL with the processing power of procedural language to create a super powerful SQL queries.  Similar to other database languages, it gives more control to the programmers by the use of loops, conditions and object oriented concepts. www.collaborationtech.co.in
  • 9. SQL SQL> create database student SQL>show database SQL>create table employee (id int(11),ename varchar(45),address varchar(45), Dob date); SQL>insert into employee values(1,’raj’,’vijayanagar bengaluru’,’02-02-2017’); SQL>desc employee SQL>select * from employee SQL> update employee set ename=‘Sunilkumar' where id=1; SQL>DELETE FROM employee WHERE id=1; www.collaborationtech.co.in
  • 10. SQL SQL>create table student (id int(11),sname varchar(45),address varchar(45),Dob date,age int(11)); SQL>insert into employee values(1,’kumar’,’vijayanagar mysore’,’01-02-2017’,20); SQL>insert into employee values(2,’sunil’,’vijayanagar bangalore’,’05-02-2017’,25); SQL>desc student SQL>select * from student SQL> update student set ename=‘Anilkumar' where id=2; SQL>DELETE FROM student WHERE id=1; SQL>create table customer (id int(11),cname varchar(45),address varchar(45),mno varchar(45)); SQL>insert into customer values(1,’chetan’,’btm bangalore’,’9865324175’); SQL>insert into customer values(2,guru’,’rpc layout bangalore’,’9586231475’); SQL>desc customer SQL>select * from customer SQL> update customer set ename=‘Vishal' where id=2; SQL>DELETE FROM customer WHERE id=1; Alter Command ALTER TABLE customer ADD Gender char(1); ALTER TABLE customer MODIFY Location char(100); www.collaborationtech.co.in
  • 11. PL/SQL BEGIN dbms_output.put_line(‘Hello World..’); END; Declaring and usage of variables in program DECLARE text VARCHAR2(45); BEGIN text:= ‘Hello World’; dbms_output.put_line(text); END; www.collaborationtech.co.in
  • 12. Ratio declare numerator number;denominator number; the_ratio number; lower_limit constant number:=0.72; samp_num constant number:=132; BEGIN SELECT X, Y INTO numerator, denominator from result_table where sample_id = samp_num; the_ratio := numerator/denominator; if the_ratio > lower_limit then insert into ratio values(samp_num, the_ratio); ELSE Insert into ratio values (samp_num,-1); END IF;commit; exception when zero_divide then insert into ratio values(samp_num,0); commit;when others then rollback; end; www.collaborationtech.co.in
  • 13. Wages CREATE FUNCTION dept-sal (dnum NUMBER) RETURN NUMBER IS CURSOR emp-cursor ISo SELECT sal, comm FROM emp WHERE deptno = dnum; total-wages NUMBER(,(:=0; cnt NUMBER(10) :=1; BEGIN FOR emp-record IN emp-cursor LOOP emp-record.comm := NVL (emp-record.comm, 0); total-wages := total-wages + emp.record, sal+emp-record-comm; PUT-LINE (LOOP number = '|| cnt ||', 'wages ='|| TO-CHAR (total-wages)); cnt := cnt+1; ENDLOOP: /* Debug Line */ PUT-LINE (Total wages ='|| TO-CHAR (total-wages)); RETURN total-wages; END dept-sal: www.collaborationtech.co.in
  • 14. Procedures and Functions in PL/SQL Procedure is a subprogram unit that consists of a group of PL/SQL statements.Procedure can have a RETURN tatement to return the control to the calling block, but it cannot return any values through the RETURN statement. CREATE OR REPLACE PROCEDURE welcome_msg(p_name IN VARCHAR2) IS BEGIN Dbms_output.put_line(‘Welcome’||p_name); END EXEC welcome_msg(‘Collaboration Technologies’); www.collaborationtech.co.in
  • 15. Follow us on Social Facebook: https://www.facebook.com/collaborationtechnologies/ Twitter : https://twitter.com/collaboration09 Google Plus : https://plus.google.com/100704494006819853579 LinkedIn : https://www.linkedin.com/in/ramananda-rao-a2012545 Instagram : https://instagram.com/collaborationtechnologies YouTube : https://www.youtube.com/channel/UCm9nK56LRbWSqcYWbzs8CUg Skype : facebook:ramananda.rao.7 WhatsApp : +91 9886272445 www.collaborationtech.co.in THANK YOU