Querying & Filtering MCQs

9 MCQs  — Oracle: Introduction & SQL Overview MCQs

Practice Querying & Filtering MCQs with correct answers and explanations. These questions are from the Oracle: Introduction & SQL Overview MCQs section.

In a LIKE pattern, what does the underscore (_) wildcard match?
Zero or more characters
Only a digit
Only a space
Exactly one character
Which statement about BETWEEN 10 AND 20 is correct?
It excludes both 10 and 20
It includes both 10 and 20
It includes 10 but excludes 20
It excludes 10 but includes 20
What is the default sort order of ORDER BY?
Ascending (ASC)
Descending (DESC)
Random
Order of insertion
How do you create a column alias containing a space?
SELECT salary 'Monthly Salary' FROM emp;
SELECT salary "Monthly Salary" FROM emp;
SELECT salary AS Monthly Salary FROM emp;
SELECT salary = Monthly Salary FROM emp;
What is a subquery?
A query that runs on another database
A query that has no FROM clause
A stored backup of a query
A query nested inside another SQL statement
Which expression is the ANSI-standard way to apply conditional logic in a SELECT?
IF ... THEN ... ENDIF
WHEN ... SWITCH ... END
CHOOSE ... WHEN ... DONE
CASE WHEN ... THEN ... ELSE ... END
What does COALESCE(a, b, c) return?
The last non-NULL value
The first non-NULL value among its arguments
The sum of non-NULL values
Always the first argument
What does NVL2(expr, a, b) return?
a if expr is NULL, otherwise b
a if expr is NOT NULL, otherwise b
Always a
Always b