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
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
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
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.
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
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
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.
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.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]