SlideShare a Scribd company logo
1 of 11
1 Using ORACLE® MANIPULATING DATA using PL/SQL
2 COMMENTING CODE We can add comments to the PL/SQL .There are two types of comments: EXAMPLE: 	DECLARE eage NUMBER ;	       --This is a single line comment . number variable defined. 	BEGIN 	SELECT age INTO eage FROM InfoTable WHERE name = ‘bill’;	/* A multiline 			command .Here the select command is defined */ 	END
3 FUNCTIONS The functions available in SQL can be used in PL/SQL code. Not all SQL function can be used in PL/SQL statements .The SQL functions unavailable in Pl/SQL statements are: DECODE function. All GROUP functions except the LEAST and GREATEST. EXAMPLE1: ename  VARCHAR2(20) := INITCAP(‘bill’); 	--stores Bill in the variable ename. We can use data type conversion function in PL/SQL statements. EXAMPLE 2: mainphone NUMBER(10) := 9000000000; ename VARCHAR2(20); BEGIN SELECT name INTO ename FROM InfoTable WHERE phone = TO_NUMBER(mainphone); END
4 Operators in PL/SQL
5 Operators EXAMPLES: profit BOOL;	sp NUMBER;	cp NUMBER; BEGIN cp:= 1000; sp:= 1200; profit := ((sp – cp) > 100);      -- finding if profit was above 100 or not END
6 RETRIEVING DATA  We can retrieve data using the SELECT command. Variables are used to store the values returned from the SELECT statement and hence have to be of the same datatype and be declared before use. SYNTAX: SELECT column, […column]  INTO  variable_name,[…variable_name] FROM table_name WHERE { expression….}; EXAMPLE: DECLARE eage NUMBER; 		BEGIN 		SELECT age INTO eage FROM InfoTable WHERE name = ‘bill’; 	DBMS_OUTPUT.PUT_LINE(‘ Age of bill is : ‘ || eage); 		END
7 INSERT command We can insert data into tables using the PL/SQL INSERT command. SYNTAX: INSERT INTO table_name (column , (…..column)) VALUES (value , (…..value)); EXAMPLE: BEGIN 		INSERT INTO InfoTable 		(name,age,phone) 		VALUES 		(‘micheal’,45,9666002203); 		END
8 UPDATE command We can update data in tables using the PL/SQL UPDATE comand. SYNTAX: UPDATE table_name SET 	column = value,  	(…column = value); WHERE	{expression }; EXAMPLE:	DECLARE eage NUMBER(5):=40; 		BEGIN 		UPDATE InfoTable SET age = eage 		WHERE name =  ‘micheal’; 		END
9 DELETE command We can delete data from tables using the PL/SQL DELETE comand. SYNTAX: DELETE  FROM table_name WHERE  { expression }; EXAMPLE: BEGIN 		DELETE  FROM InfoTable 		WHERE  age = 45 ; 		END
10 MERGE COMMAND The MERGE comand is use to merge the data of one table into the data of another table.The merge command updates or inserts rows in order to make data in both rows similar. DECLARE ename INFOTABLE.NAME%TYPE := ‘bill'; BEGIN 	MERGE INTO addtable a      	USING infotable I					Infotable      	ON (i.name =ename)				    	WHEN MATCHED THEN      	UPDATE SET a.phone = i.phoneADDtable    	WHEN NOT MATCHED THEN      	INSERT VALUES(i.name,NULL,i.phone);		 END; ADDtable after MERGE
THANK YOU 11 THANK YOU FOR VIEWING THIS PRESENTATION FOR MORE PRESENTATIONS AND VIDEOS ON ORACLE AND DATAMINING , please visit:   www.dataminingtools.net

More Related Content

What's hot

Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sqlSushil Mishra
 
Belajar Menghindari SQL Injection dengan Simulasi
Belajar Menghindari SQL Injection dengan SimulasiBelajar Menghindari SQL Injection dengan Simulasi
Belajar Menghindari SQL Injection dengan SimulasiRio Astamal
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql SyntaxReka
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries Prabu Cse
 
Mysqlppt
MysqlpptMysqlppt
MysqlpptReka
 

What's hot (11)

Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
 
Les11
Les11Les11
Les11
 
Belajar Menghindari SQL Injection dengan Simulasi
Belajar Menghindari SQL Injection dengan SimulasiBelajar Menghindari SQL Injection dengan Simulasi
Belajar Menghindari SQL Injection dengan Simulasi
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
Duplicaterows
DuplicaterowsDuplicaterows
Duplicaterows
 
Les02
Les02Les02
Les02
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
Les03
Les03Les03
Les03
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Les09
Les09Les09
Les09
 
Les13
Les13Les13
Les13
 

Viewers also liked

Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle DatabaseChhom Karath
 
Paramount Search Partners
Paramount Search PartnersParamount Search Partners
Paramount Search Partnersjjmcdermott
 
DataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business ApplicationsDataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business ApplicationsTibbs Pereira
 
Facebook: An Innovative Influenza Pandemic Early Warning System
Facebook: An Innovative Influenza Pandemic Early Warning SystemFacebook: An Innovative Influenza Pandemic Early Warning System
Facebook: An Innovative Influenza Pandemic Early Warning SystemChen Luo
 
Festivals Refuerzo
Festivals RefuerzoFestivals Refuerzo
Festivals Refuerzoguest9536ef5
 
Data-Applied: Technology Insights
Data-Applied: Technology InsightsData-Applied: Technology Insights
Data-Applied: Technology InsightsDataminingTools Inc
 
Excel Datamining Addin Intermediate
Excel Datamining Addin IntermediateExcel Datamining Addin Intermediate
Excel Datamining Addin IntermediateDataminingTools Inc
 
Ireland Apo University Fy 10 Tibbs Slideshare
Ireland Apo University Fy 10 Tibbs SlideshareIreland Apo University Fy 10 Tibbs Slideshare
Ireland Apo University Fy 10 Tibbs SlideshareTibbs Pereira
 
Research Presentation
Research PresentationResearch Presentation
Research Presentationguest136b28e
 
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data miningMS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data miningDataminingTools Inc
 
HistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN IiHistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN Iilara
 

Viewers also liked (20)

Erika
ErikaErika
Erika
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle Database
 
Test
TestTest
Test
 
Paramount Search Partners
Paramount Search PartnersParamount Search Partners
Paramount Search Partners
 
DataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business ApplicationsDataKraft - Powerful No-Coding Platform for Business Applications
DataKraft - Powerful No-Coding Platform for Business Applications
 
Facebook: An Innovative Influenza Pandemic Early Warning System
Facebook: An Innovative Influenza Pandemic Early Warning SystemFacebook: An Innovative Influenza Pandemic Early Warning System
Facebook: An Innovative Influenza Pandemic Early Warning System
 
Control Statements in Matlab
Control Statements in  MatlabControl Statements in  Matlab
Control Statements in Matlab
 
Festivals Refuerzo
Festivals RefuerzoFestivals Refuerzo
Festivals Refuerzo
 
LISP: Scope and extent in lisp
LISP: Scope and extent in lispLISP: Scope and extent in lisp
LISP: Scope and extent in lisp
 
Data-Applied: Technology Insights
Data-Applied: Technology InsightsData-Applied: Technology Insights
Data-Applied: Technology Insights
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Excel Datamining Addin Intermediate
Excel Datamining Addin IntermediateExcel Datamining Addin Intermediate
Excel Datamining Addin Intermediate
 
Ireland Apo University Fy 10 Tibbs Slideshare
Ireland Apo University Fy 10 Tibbs SlideshareIreland Apo University Fy 10 Tibbs Slideshare
Ireland Apo University Fy 10 Tibbs Slideshare
 
LISP: Errors In Lisp
LISP: Errors In LispLISP: Errors In Lisp
LISP: Errors In Lisp
 
MED dra Coding -MSSO
MED dra Coding -MSSOMED dra Coding -MSSO
MED dra Coding -MSSO
 
Probability And Its Axioms
Probability And Its AxiomsProbability And Its Axioms
Probability And Its Axioms
 
Research Presentation
Research PresentationResearch Presentation
Research Presentation
 
Quick Look At Clustering
Quick Look At ClusteringQuick Look At Clustering
Quick Look At Clustering
 
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data miningMS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data mining
 
HistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN IiHistoriografíA Latina LatíN Ii
HistoriografíA Latina LatíN Ii
 

Similar to Oracle: PLSQL Commands

Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Thuan Nguyen
 
Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01Thuan Nguyen
 
Les18[1]Interacting with the Oracle Server
Les18[1]Interacting with  the Oracle ServerLes18[1]Interacting with  the Oracle Server
Les18[1]Interacting with the Oracle Serversiavosh kaviani
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commandsBelle Wx
 
Oracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |ThrissurOracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |ThrissurIndiaOptions Softwares
 
e computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql pluse computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql plusecomputernotes
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Thuan Nguyen
 
Database Management System
Database Management SystemDatabase Management System
Database Management SystemHitesh Mohapatra
 
Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with examplepranav kumar verma
 
Oracle - Program with PL/SQL - Lession 05
Oracle - Program with PL/SQL - Lession 05Oracle - Program with PL/SQL - Lession 05
Oracle - Program with PL/SQL - Lession 05Thuan Nguyen
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standardsAlessandro Baratella
 
Basic sqlstatements
Basic sqlstatementsBasic sqlstatements
Basic sqlstatementsAnjac
 
02 Writing Executable Statments
02 Writing Executable Statments02 Writing Executable Statments
02 Writing Executable Statmentsrehaniltifat
 

Similar to Oracle: PLSQL Commands (20)

Plsql
PlsqlPlsql
Plsql
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03
 
Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01
 
Les18[1]Interacting with the Oracle Server
Les18[1]Interacting with  the Oracle ServerLes18[1]Interacting with  the Oracle Server
Les18[1]Interacting with the Oracle Server
 
PL-SQL.pdf
PL-SQL.pdfPL-SQL.pdf
PL-SQL.pdf
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
My SQL.pptx
My SQL.pptxMy SQL.pptx
My SQL.pptx
 
Oracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |ThrissurOracle Training in Kochi | Trivandrum |Thrissur
Oracle Training in Kochi | Trivandrum |Thrissur
 
e computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql pluse computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql plus
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with example
 
Oracle : DML
Oracle : DMLOracle : DML
Oracle : DML
 
Oracle - Program with PL/SQL - Lession 05
Oracle - Program with PL/SQL - Lession 05Oracle - Program with PL/SQL - Lession 05
Oracle - Program with PL/SQL - Lession 05
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
Basic sqlstatements
Basic sqlstatementsBasic sqlstatements
Basic sqlstatements
 
02 Writing Executable Statments
02 Writing Executable Statments02 Writing Executable Statments
02 Writing Executable Statments
 
Oracle: Commands
Oracle: CommandsOracle: Commands
Oracle: Commands
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 

More from DataminingTools Inc

AI: Introduction to artificial intelligence
AI: Introduction to artificial intelligenceAI: Introduction to artificial intelligence
AI: Introduction to artificial intelligenceDataminingTools Inc
 
Data Mining: Text and web mining
Data Mining: Text and web miningData Mining: Text and web mining
Data Mining: Text and web miningDataminingTools Inc
 
Data Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence dataData Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence dataDataminingTools Inc
 
Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsDataminingTools Inc
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisDataminingTools Inc
 
Data warehouse and olap technology
Data warehouse and olap technologyData warehouse and olap technology
Data warehouse and olap technologyDataminingTools Inc
 

More from DataminingTools Inc (20)

Terminology Machine Learning
Terminology Machine LearningTerminology Machine Learning
Terminology Machine Learning
 
Techniques Machine Learning
Techniques Machine LearningTechniques Machine Learning
Techniques Machine Learning
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning Introduction
 
Areas of machine leanring
Areas of machine leanringAreas of machine leanring
Areas of machine leanring
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
 
AI: Logic in AI 2
AI: Logic in AI 2AI: Logic in AI 2
AI: Logic in AI 2
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
AI: Learning in AI 2
AI: Learning in AI 2AI: Learning in AI 2
AI: Learning in AI 2
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
 
AI: Introduction to artificial intelligence
AI: Introduction to artificial intelligenceAI: Introduction to artificial intelligence
AI: Introduction to artificial intelligence
 
AI: Belief Networks
AI: Belief NetworksAI: Belief Networks
AI: Belief Networks
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Data Mining: Text and web mining
Data Mining: Text and web miningData Mining: Text and web mining
Data Mining: Text and web mining
 
Data Mining: Outlier analysis
Data Mining: Outlier analysisData Mining: Outlier analysis
Data Mining: Outlier analysis
 
Data Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence dataData Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence data
 
Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlations
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysis
 
Data warehouse and olap technology
Data warehouse and olap technologyData warehouse and olap technology
Data warehouse and olap technology
 
Data Mining: Data processing
Data Mining: Data processingData Mining: Data processing
Data Mining: Data processing
 

Recently uploaded

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Oracle: PLSQL Commands

  • 1. 1 Using ORACLE® MANIPULATING DATA using PL/SQL
  • 2. 2 COMMENTING CODE We can add comments to the PL/SQL .There are two types of comments: EXAMPLE: DECLARE eage NUMBER ; --This is a single line comment . number variable defined. BEGIN SELECT age INTO eage FROM InfoTable WHERE name = ‘bill’; /* A multiline command .Here the select command is defined */ END
  • 3. 3 FUNCTIONS The functions available in SQL can be used in PL/SQL code. Not all SQL function can be used in PL/SQL statements .The SQL functions unavailable in Pl/SQL statements are: DECODE function. All GROUP functions except the LEAST and GREATEST. EXAMPLE1: ename VARCHAR2(20) := INITCAP(‘bill’); --stores Bill in the variable ename. We can use data type conversion function in PL/SQL statements. EXAMPLE 2: mainphone NUMBER(10) := 9000000000; ename VARCHAR2(20); BEGIN SELECT name INTO ename FROM InfoTable WHERE phone = TO_NUMBER(mainphone); END
  • 4. 4 Operators in PL/SQL
  • 5. 5 Operators EXAMPLES: profit BOOL; sp NUMBER; cp NUMBER; BEGIN cp:= 1000; sp:= 1200; profit := ((sp – cp) > 100); -- finding if profit was above 100 or not END
  • 6. 6 RETRIEVING DATA We can retrieve data using the SELECT command. Variables are used to store the values returned from the SELECT statement and hence have to be of the same datatype and be declared before use. SYNTAX: SELECT column, […column] INTO variable_name,[…variable_name] FROM table_name WHERE { expression….}; EXAMPLE: DECLARE eage NUMBER; BEGIN SELECT age INTO eage FROM InfoTable WHERE name = ‘bill’; DBMS_OUTPUT.PUT_LINE(‘ Age of bill is : ‘ || eage); END
  • 7. 7 INSERT command We can insert data into tables using the PL/SQL INSERT command. SYNTAX: INSERT INTO table_name (column , (…..column)) VALUES (value , (…..value)); EXAMPLE: BEGIN INSERT INTO InfoTable (name,age,phone) VALUES (‘micheal’,45,9666002203); END
  • 8. 8 UPDATE command We can update data in tables using the PL/SQL UPDATE comand. SYNTAX: UPDATE table_name SET column = value, (…column = value); WHERE {expression }; EXAMPLE: DECLARE eage NUMBER(5):=40; BEGIN UPDATE InfoTable SET age = eage WHERE name = ‘micheal’; END
  • 9. 9 DELETE command We can delete data from tables using the PL/SQL DELETE comand. SYNTAX: DELETE FROM table_name WHERE { expression }; EXAMPLE: BEGIN DELETE FROM InfoTable WHERE age = 45 ; END
  • 10. 10 MERGE COMMAND The MERGE comand is use to merge the data of one table into the data of another table.The merge command updates or inserts rows in order to make data in both rows similar. DECLARE ename INFOTABLE.NAME%TYPE := ‘bill'; BEGIN MERGE INTO addtable a USING infotable I Infotable ON (i.name =ename) WHEN MATCHED THEN UPDATE SET a.phone = i.phoneADDtable WHEN NOT MATCHED THEN INSERT VALUES(i.name,NULL,i.phone); END; ADDtable after MERGE
  • 11. THANK YOU 11 THANK YOU FOR VIEWING THIS PRESENTATION FOR MORE PRESENTATIONS AND VIDEOS ON ORACLE AND DATAMINING , please visit: www.dataminingtools.net