SQL ORACLE ACADEMY SECTION 2 ( USING VARIABLES)

1.After they are declared, variables can be used only once in an application. True or False?
 *False
2.Variables may be reused. True or False?
 *True
3.Which of the following are required when declaring a variable? (Choose two.)
 *Identifier name
 *Data type
4.Constants must be initialized. True or False?
   *True
5.Evaluate the following declaration. Determine whether or not it is legal.
DECLARE
    name,dept VARCHAR2(14);
*illegal

6.Evaluate the following declaration. Determine whether or not it is legal.
DECLARE
    test NUMBER(5); 

*legal

7.A function called FORMAT_TODAYS_DATE accepts no parameters and returns today's date in the format: Month DD, YYYY
The following anonymous block invokes the function:

DECLARE v_today DATE; BEGIN -- invoke the function here

Which of the following statements correctly assigns the date variable v_today to the value returned by the format_todays_date function?


*v_today := TO_DATE(format_todays_date, 'Month DD, YYYY');

8.Examine the following variable declarations:
DECLARE v_number NUMBER := 10; v_result NUMBER;
Which of the following correctly assigns the value 50 to V_RESULT?
 
























*All of the above 

Comments