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 (20)

TID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseTID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To Database
WanBK 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
 
Lec01
Lec01Lec01
Lec01
Suresh Sankaranarayanan
 
Dbms and sqlpptx
Dbms and sqlpptxDbms and sqlpptx
Dbms and sqlpptx
thesupermanreturns
 
Dbms Concepts
Dbms ConceptsDbms Concepts
Dbms Concepts
adukkas
 
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 revised
mnodalo
 
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
dbms
PravinGhosekar
 
Mydbms
MydbmsMydbms
Mydbms
Shivalik college of engineering
 
Dbms unit01
Dbms unit01Dbms unit01
Dbms unit01
Ila Chandana
 
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
 
TID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseTID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To Database
WanBK 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 Concepts
Dbms ConceptsDbms Concepts
Dbms Concepts
adukkas
 
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
 
Relational database revised
Relational database revisedRelational database revised
Relational database revised
mnodalo
 
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
 
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
 

Viewers also liked (20)

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
 
Sql Overview
Sql OverviewSql Overview
Sql Overview
Randy Riness @ South Puget Sound Community College
 
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
 
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
 
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
 
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
 
Ad

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
Harmony Kwawu
 
introduction to SQL query language beginner.ppt
introduction to SQL query language beginner.pptintroduction to SQL query language beginner.ppt
introduction to SQL query language beginner.ppt
PatriceRochon1
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
Sqlperfomance
 
Sql server
Sql serverSql server
Sql server
Puja Gupta
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
CPD INDIA
 
lovely
lovelylovely
lovely
love0323
 
SQL Training courses.pptx
SQL Training courses.pptxSQL Training courses.pptx
SQL Training courses.pptx
irfanakram32
 
Sql
SqlSql
Sql
snegacmr
 
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
 
SQL overview and software
SQL overview and softwareSQL overview and software
SQL overview and software
Randy Riness @ South Puget Sound Community College
 
Module02
Module02Module02
Module02
Sridhar P
 
Shrikanth
ShrikanthShrikanth
Shrikanth
Shrikanth DM
 
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
Intro
Sudharsan S
 
Dbms & prog lang
Dbms & prog langDbms & prog lang
Dbms & prog lang
Tech_MX
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
webhostingguy
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
webhostingguy
 
Introduction to Structured Query Language
Introduction to Structured Query LanguageIntroduction to Structured Query Language
Introduction to Structured Query Language
agrawalmonikacomp
 
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
 
introduction to SQL query language beginner.ppt
introduction to SQL query language beginner.pptintroduction to SQL query language beginner.ppt
introduction to SQL query language beginner.ppt
PatriceRochon1
 
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
 
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
 
Dbms & prog lang
Dbms & prog langDbms & prog lang
Dbms & prog lang
Tech_MX
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
webhostingguy
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
webhostingguy
 
Introduction to Structured Query Language
Introduction to Structured Query LanguageIntroduction to Structured Query Language
Introduction to Structured Query Language
agrawalmonikacomp
 
Ad

More from Collaboration Technologies (16)

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
 

Recently uploaded (20)

“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 

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