The default character for specifying runtime variables in SELECT statements is :-
-
percentage sign
-
Quotation marks
-
Ampersand
-
Ellipses
To solve this question, the user needs to be aware of the syntax used to specify runtime variables in SQL SELECT statements.
The correct answer is:
C. Ampersand
Explanation: In SQL SELECT statements, runtime variables are specified using the ampersand (&) character followed by the variable name. For example, to specify a variable named "dept_name", you would use "&dept_name" in the SELECT statement. This allows users to enter a value for the variable at runtime, rather than hard-coding the value into the query.
Option A (percentage sign) is incorrect, as this character is commonly used as a wildcard operator in SQL, but not for specifying runtime variables.
Option B (quotation marks) is also incorrect, as quotation marks are used to delimit string literals in SQL, but not for specifying runtime variables.
Option D (ellipses) is incorrect, as ellipses are not used in SQL syntax for specifying runtime variables.
Therefore, the correct answer is:
The Answer is: C. Ampersand
In SQL*Plus, the ampersand (&) is the default substitution character used to prompt for and insert runtime variable values into a SELECT statement (e.g. WHERE id = &emp_id). It can be changed with the SET DEFINE command, but out of the box it's &.