PL/SQL Questions and Answers – PL/SQL Operators

This set of PL/SQL Multiple Choice Questions & Answers (MCQs) focuses on “PL/SQL Operators”.

1. In PL/SQL which of the following operator is used to raise the power of an operand exponentially?
a) *
b) ^
c) **
d) Power
View Answer

Answer: c
Explanation: In PL/SQL, ** operator is used to perform exponentiation operation which means the first operand raised to the power the second operand. Example – a = 3, b = 2, a**b = 9.

2. Relational operators returns their result in form of true and false.
a) True
b) False
View Answer

Answer: a
Explanation: Relational operators are used to compare two values and return the result in the form of boolean value(true or false). They are mostly used in conditions where some sort of comparison is required.

3. Which of the following operator is used to match a single character or group of characters (string) to a given string?
a) SELECT
b) LIKE
c) IN
d) BETWEEN
View Answer

Answer: b
Explanation: The LIKE operator is used to match a single character or group of characters(string). There are two wildcard characters which are used for the purpose of matching. % is used to match a string of any characters and _ is used to match a single character.
advertisement
advertisement

4. Which of the following operator is used to see if the operand value is null or not?
a) NULL
b) IS NULL
c) IS NOT NULL
d) NOT NULL
View Answer

Answer: b
Explanation: The IS NULL is used to see if the operand value is null or not operator. It returns true if the operand value is NULL otherwise it returns false.

5. What will be the output of the following PL/SQL statement?

SELECT * FROM student WHERE city NOT IN ('Delhi','Mumbai','Chennai');

a) Returns student’s data whose city is Delhi, Mumbai or Chennai
b) Returns student’s data whose city is Delhi but not Mumbai or Chennai
c) Returns student’s data whose city is Mumbai but not Delhi or Chennai
d) Returns student’s data whose city is not Delhi, Mumbai or Chennai
View Answer

Answer: d
Explanation: The IN operator is used when any value is required to be compared to a given list of values. It returns true if the value is present in the given list otherwise it returns false. Since, NOT is attached in front of IN, so the statement will return the record of the students whose city is not Delhi, Mumbai or Chennai.
advertisement

Sanfoundry Global Education & Learning Series – PL/SQL.

To practice all areas of PL/SQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.