RelationalDBDesignRelationalDBDesign


SQL* Plus CLI  «Prev  Next»

User input and scripting - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 

1. How does @ differ from @@ when it comes to executing a script?
Please select the best answer.
  A. @ executes a script just once, while @@ may be used to execute it twice. The number of @ symbols controls the number of iterations.
  B. @@ causes SQL*Plus to look for the script in the directory containing the parent script, while @ causes SQL*Plus to start looking in the current working directory.
  C. @@ causes SQL*Plus to use the specially defined SQL*Plus search path, while the @ sign causes SQL*Plus to look only in the current working directory.
  D. @@ allows you to run scripts that prompt the user for input and that use substitution variables. @ only allows you to run non-interactive scripts.

2. What characters mark the beginning and the end of a substitution variable?
Please select the best answer.
  A. The ampersand (&) and the period (.)
  B. The dollar-sign ($) and the period (.)
  C. The ampersand (&) and the forward-slash (/)
  D. The percent-sign (%) and the period (.)

3. What does SQL*Plus do when it encounters a substitution variable?
Please select the best answer.
  A. It always prompts you for a value, defines the variable with that value, and stores that value in the database.
  B. It attempts to retrieve the variable's value from the database, prompts you for a value if none was found in the database, and then uses that value in the command or SQL statement.
  C. It displays the statement for you to look at, allows you to edit that statement, and executes the result.
  D. It checks to see if the variable has been defined, prompts you for a value if it hasn't been defined, and then uses that value in the command or SQL statement.

4. Which of the following commands will display text to a user who is running a SQL*Plus script?
Please select the best answer.
  A. MESSAGE "Only the DBA should run this script!"
  B. DISPLAY "Only the DBA should run this script!"
  C. PROMPT "Only the DBA should run this script!"
  D. PRINT "Only the DBA should run this script!"

5. Which of the following commands will prompt the user for a table name?
Please select the best answer.
  A. ACCEPT table_name PROMPT "Enter a table name >"
  B. PROMPT "Enter a table name >" ACCEPT table_name
  C. INPUT table_name PROMPT "Enter a table name >"
  D. ACCEPT table_name FROM USER WITH "Enter a table name >"

Score =
Correct answers: