SlideShare a Scribd company logo
1 of 23
Q 3 - Which of the following is true about
the following code snippet?
DECLARE
a number(3) := 100;
BEGIN
IF (a = 50 ) THEN
dbms_output.put_line('Value of a is 10' );
ELSEIF ( a = 75 ) THEN
dbms_output.put_line('Value of a is 20' );
ELSE
dbms_output.put_line('None of the values is matching');
END IF;
dbms_output.put_line('Exact value of a is: '|| a ); END;
A - It has syntax error.
B - It will print 'None of the values is matching'.
C - It will print None of the values is matching Exact value of a is: 100
D - None of the above.
A Stored Procedure is a
a. Sequence of SQL or PL/SQL
statements to perform specific function.
b. b. Stored in compiled form in the
database.
c. c. Can be called from all client
environments.
d. d. All of the above.
Which of the following is NOT
VALID in PL/SQL ?
a] Select ... Into
b] Update
c] Create
d] Delete
What is the Result of the
following 'VIK'||NULL||'RAM' ?
a] Error
b] VIK RAM
c] VIKRAM
d] NULL
 Declare
a number := 5; b number := null; c number :=
10;
Begin
if a > b AND a < c then
a := c * a;
end if;
End;
What will be the value of 'a' after execution ?
a] 50
b] NULL
c] 5
d] None of the above
Consider the following code
snippet: how many times the
loop will run?
DECLARE a number(2) := 9;
BEGIN
WHILE a < 30
LOOP a := a + 3;
END LOOP; END;
A - 10
B - 8
C - 7
D - 9
- Which of the following is
true about comments in
PL/SQL?
A - Comments are explanatory statements.
B - PL/SQL supports both single-line and
multi-line comments.
C - The PL/SQL single-line comments start
with the delimiter -- (double hyphen) and
multi-line comments are enclosed by /* and
*/.
D - All of the above.
DECLARE
a number;
PROCEDURE
squareNum(x IN OUT number)
IS
BEGIN
x := x * x;
END;
BEGIN
a:= 5;
squareNum(a);
dbms_output.put_line(a);
END;
A - 5
B - 10
C - 25
D - 0
What will be the output of the
following code snippet?
DECLARE
a number(3) := 100;
b number(3) := 200;
BEGIN
IF( a = 100 ) THEN
IF( b <> 200 ) THEN
dbms_output.put_line(b);
END IF;
END IF;
dbms_output.put_line(a);
END;
A - It has syntax error, so there will not be any output.
B - 200
C - 200 100
D - 100
What will happen when the code is executed?
DECLARE num number := 95;
BEGIN dbms_output.put_line('num: ' || num1);
DECLARE
num number := 195;
BEGIN
dbms_output.put_line('num: ' || num1);
END;
END;
A - It won’t execute, it has syntax error
B - It will print
num: 95
num: 195
C - It will print
num: 95
num: 95
D - It will print
num: 195
num: 195
Consider the following code
snippet: how many times the
loop will run?
DECLARE
a number(2) := 9;
BEGIN
WHILE a < 30 LOOP a := a + 3;
END LOOP; END;
A - 10
B - 8
C - 7
D - 9
CREATE OR REPLACE FUNCTION
totalCustomers total number(2) := 0;
BEGIN
SELECT count(*) into total FROM customers;
RETURN total;
END;
A - It doesn’t have the RETURN clause in function
declaration.
B - The RETURN statement is wrong.
C - Function definition should not use the IS
keyword
D - Nothing wrong.
Which of the following is true about the
execution section of a PL/SQL block?
 A - It is enclosed between the keywords
BEGIN and END.
 B - It is a mandatory section.
 C - It consists of the executable PL/SQL
statements.
 D - All of the above.
What is the output of the
following code?
DECLARE
x number := 4;
BEGIN
LOOP
dbms_output.put_line(x);
x := x + 1;
exit
WHEN x > 5;
END LOOP;
dbms_output.put_line(x);
END;
A - 4 5 6
B - 4 5
C - 4
D - None of the above.
DECLARE
num number;
fn number;
FUNCTION fx(x number) RETURN number IS
f number;
BEGIN
IF x=0 THEN
f := 1; ELSE
f := x * fx(x-1);
END IF;
RETURN f;
END;
BEGIN
num:= 5;
Fn := fx(num);
dbms_output.put_line(fn);
END;
A - 1
B - 5
C - 10
D - 125
Which of the following is the
correct syntax for creating an
explicit cursor?

 A - CURSOR cursor_name IS
select_statement;
 B - CREATE CURSOR cursor_name IS
select_statement;
 C - CREATE CURSOR cursor_name AS
select_statement;
 D - CURSOR cursor_name AS
select_statement;
What would be printed when the following code is
executed?
DECLARE
x NUMBER;
BEGIN
x := 5; x := 10;
dbms_output.put_line(-x);
dbms_output.put_line(+x);
x := -10;
dbms_output.put_line(-x);
dbms_output.put_line(+x);
END;
A -10 10 10 -10
B 10 -10 10-10
C -10 +10 +10 -10
D - 10 -10 -10 10
Which of the following
statements is true about
implicit cursors?
A.Implicit cursors are used for SQL statements that
are not named.
B. Developers should use implicit cursors with great
care.
C. Implicit cursors are used in cursor for loops to
handle data processing.
D. Implicit cursors are no longer a feature in Oracle.
Select invalid variable types
A. CHAR
B. VARCHAR1
C. VARCHAR2
D. INTEGER
E. NUMBER
 he || is is an example of what function
SELECT last_name || ', ' || first_name || ' ' ||
middle_name
FROM employees;
A. Incantination
B. Integration
C. Continuation
D. Concatenation
E. None of the above
Select the best answer. Which listed
attribute is an invalid attribute of an
Explicit cursor.
A. %NOTFOUND
B. %FOUND
C. %ROWCOUNT
D. %ISOPEN
E. None of the above. All of these are valid.
PL SQL Quiz |  PL SQL Examples

More Related Content

What's hot (20)

Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
 
04 Handling Exceptions
04 Handling Exceptions04 Handling Exceptions
04 Handling Exceptions
 
Java generics
Java genericsJava generics
Java generics
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
11 constructors in derived classes
11 constructors in derived classes11 constructors in derived classes
11 constructors in derived classes
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
C basics
C   basicsC   basics
C basics
 
Sql subquery
Sql  subquerySql  subquery
Sql subquery
 
Simple Java Programs
Simple Java ProgramsSimple Java Programs
Simple Java Programs
 
Procedures and triggers in SQL
Procedures and triggers in SQLProcedures and triggers in SQL
Procedures and triggers in SQL
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
C# Basics
C# BasicsC# Basics
C# Basics
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
Triggers in SQL | Edureka
Triggers in SQL | EdurekaTriggers in SQL | Edureka
Triggers in SQL | Edureka
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsql
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 

Viewers also liked

Spectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | NetworkingSpectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | NetworkingShubham Dwivedi
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle DatabaseChhom Karath
 
pl/sql online Training|sql online Training | iTeknowledge
pl/sql online Training|sql online Training | iTeknowledgepl/sql online Training|sql online Training | iTeknowledge
pl/sql online Training|sql online Training | iTeknowledgeMasood Khan
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts Bharat Kalia
 
The Power of the Junior
The Power of the JuniorThe Power of the Junior
The Power of the JuniorYves Hanoulle
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals INick Buytaert
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSmohdoracle
 

Viewers also liked (9)

Plsqlobj
PlsqlobjPlsqlobj
Plsqlobj
 
Spectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | NetworkingSpectrum vs Bandwidth vs Datarate | Networking
Spectrum vs Bandwidth vs Datarate | Networking
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle Database
 
pl/sql online Training|sql online Training | iTeknowledge
pl/sql online Training|sql online Training | iTeknowledgepl/sql online Training|sql online Training | iTeknowledge
pl/sql online Training|sql online Training | iTeknowledge
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
The Power of the Junior
The Power of the JuniorThe Power of the Junior
The Power of the Junior
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 

Similar to PL SQL Quiz | PL SQL Examples

PL-SQL DIFFERENT PROGRAMS
PL-SQL DIFFERENT PROGRAMSPL-SQL DIFFERENT PROGRAMS
PL-SQL DIFFERENT PROGRAMSraj upadhyay
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answersdebarghyamukherjee60
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01Ahmed Gamal
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartsSamuel Igbanogu
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...ssuserd6b1fd
 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5PRADEEP
 
How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)Maik Becker
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSESujata Regoti
 
C Programming by Süleyman Kondakci
C Programming by Süleyman KondakciC Programming by Süleyman Kondakci
C Programming by Süleyman KondakciSüleyman Kondakci
 

Similar to PL SQL Quiz | PL SQL Examples (20)

PL-SQL.pdf
PL-SQL.pdfPL-SQL.pdf
PL-SQL.pdf
 
PL-SQL DIFFERENT PROGRAMS
PL-SQL DIFFERENT PROGRAMSPL-SQL DIFFERENT PROGRAMS
PL-SQL DIFFERENT PROGRAMS
 
What is c
What is cWhat is c
What is c
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
plsql.ppt
plsql.pptplsql.ppt
plsql.ppt
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
 
How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)How to transfer bad PLSQL into good (AAAPEKS23)
How to transfer bad PLSQL into good (AAAPEKS23)
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Sort presentation
Sort presentationSort presentation
Sort presentation
 
1 z0 001
1 z0 0011 z0 001
1 z0 001
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSE
 
C Programming by Süleyman Kondakci
C Programming by Süleyman KondakciC Programming by Süleyman Kondakci
C Programming by Süleyman Kondakci
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
C language
C languageC language
C language
 

Recently uploaded

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

PL SQL Quiz | PL SQL Examples

  • 1.
  • 2. Q 3 - Which of the following is true about the following code snippet? DECLARE a number(3) := 100; BEGIN IF (a = 50 ) THEN dbms_output.put_line('Value of a is 10' ); ELSEIF ( a = 75 ) THEN dbms_output.put_line('Value of a is 20' ); ELSE dbms_output.put_line('None of the values is matching'); END IF; dbms_output.put_line('Exact value of a is: '|| a ); END; A - It has syntax error. B - It will print 'None of the values is matching'. C - It will print None of the values is matching Exact value of a is: 100 D - None of the above.
  • 3. A Stored Procedure is a a. Sequence of SQL or PL/SQL statements to perform specific function. b. b. Stored in compiled form in the database. c. c. Can be called from all client environments. d. d. All of the above.
  • 4. Which of the following is NOT VALID in PL/SQL ? a] Select ... Into b] Update c] Create d] Delete
  • 5. What is the Result of the following 'VIK'||NULL||'RAM' ? a] Error b] VIK RAM c] VIKRAM d] NULL
  • 6.  Declare a number := 5; b number := null; c number := 10; Begin if a > b AND a < c then a := c * a; end if; End; What will be the value of 'a' after execution ? a] 50 b] NULL c] 5 d] None of the above
  • 7. Consider the following code snippet: how many times the loop will run? DECLARE a number(2) := 9; BEGIN WHILE a < 30 LOOP a := a + 3; END LOOP; END; A - 10 B - 8 C - 7 D - 9
  • 8. - Which of the following is true about comments in PL/SQL? A - Comments are explanatory statements. B - PL/SQL supports both single-line and multi-line comments. C - The PL/SQL single-line comments start with the delimiter -- (double hyphen) and multi-line comments are enclosed by /* and */. D - All of the above.
  • 9. DECLARE a number; PROCEDURE squareNum(x IN OUT number) IS BEGIN x := x * x; END; BEGIN a:= 5; squareNum(a); dbms_output.put_line(a); END; A - 5 B - 10 C - 25 D - 0
  • 10. What will be the output of the following code snippet? DECLARE a number(3) := 100; b number(3) := 200; BEGIN IF( a = 100 ) THEN IF( b <> 200 ) THEN dbms_output.put_line(b); END IF; END IF; dbms_output.put_line(a); END; A - It has syntax error, so there will not be any output. B - 200 C - 200 100 D - 100
  • 11. What will happen when the code is executed? DECLARE num number := 95; BEGIN dbms_output.put_line('num: ' || num1); DECLARE num number := 195; BEGIN dbms_output.put_line('num: ' || num1); END; END; A - It won’t execute, it has syntax error B - It will print num: 95 num: 195 C - It will print num: 95 num: 95 D - It will print num: 195 num: 195
  • 12. Consider the following code snippet: how many times the loop will run? DECLARE a number(2) := 9; BEGIN WHILE a < 30 LOOP a := a + 3; END LOOP; END; A - 10 B - 8 C - 7 D - 9
  • 13. CREATE OR REPLACE FUNCTION totalCustomers total number(2) := 0; BEGIN SELECT count(*) into total FROM customers; RETURN total; END; A - It doesn’t have the RETURN clause in function declaration. B - The RETURN statement is wrong. C - Function definition should not use the IS keyword D - Nothing wrong.
  • 14. Which of the following is true about the execution section of a PL/SQL block?  A - It is enclosed between the keywords BEGIN and END.  B - It is a mandatory section.  C - It consists of the executable PL/SQL statements.  D - All of the above.
  • 15. What is the output of the following code? DECLARE x number := 4; BEGIN LOOP dbms_output.put_line(x); x := x + 1; exit WHEN x > 5; END LOOP; dbms_output.put_line(x); END; A - 4 5 6 B - 4 5 C - 4 D - None of the above.
  • 16. DECLARE num number; fn number; FUNCTION fx(x number) RETURN number IS f number; BEGIN IF x=0 THEN f := 1; ELSE f := x * fx(x-1); END IF; RETURN f; END; BEGIN num:= 5; Fn := fx(num); dbms_output.put_line(fn); END; A - 1 B - 5 C - 10 D - 125
  • 17. Which of the following is the correct syntax for creating an explicit cursor?   A - CURSOR cursor_name IS select_statement;  B - CREATE CURSOR cursor_name IS select_statement;  C - CREATE CURSOR cursor_name AS select_statement;  D - CURSOR cursor_name AS select_statement;
  • 18. What would be printed when the following code is executed? DECLARE x NUMBER; BEGIN x := 5; x := 10; dbms_output.put_line(-x); dbms_output.put_line(+x); x := -10; dbms_output.put_line(-x); dbms_output.put_line(+x); END; A -10 10 10 -10 B 10 -10 10-10 C -10 +10 +10 -10 D - 10 -10 -10 10
  • 19. Which of the following statements is true about implicit cursors? A.Implicit cursors are used for SQL statements that are not named. B. Developers should use implicit cursors with great care. C. Implicit cursors are used in cursor for loops to handle data processing. D. Implicit cursors are no longer a feature in Oracle.
  • 20. Select invalid variable types A. CHAR B. VARCHAR1 C. VARCHAR2 D. INTEGER E. NUMBER
  • 21.  he || is is an example of what function SELECT last_name || ', ' || first_name || ' ' || middle_name FROM employees; A. Incantination B. Integration C. Continuation D. Concatenation E. None of the above
  • 22. Select the best answer. Which listed attribute is an invalid attribute of an Explicit cursor. A. %NOTFOUND B. %FOUND C. %ROWCOUNT D. %ISOPEN E. None of the above. All of these are valid.

Editor's Notes

  1. Answer : A Explanation the ELSIF statement is wrongly written as ELSEIF
  2. D
  3. Ans : C
  4. c
  5. Ans : C
  6. c
  7. D
  8. C
  9. D
  10. B
  11. C
  12. A
  13. D
  14. A
  15. D
  16. A
  17. A
  18. A
  19. B
  20. D
  21. E