Lab 3.1 Self-Review Questions


In order to test your progress, you should be able to answer the following questions.

1)

If a variable is declared as follows , what are the results?

 
 v_fixed_amount CONSTANT NUMBER; 
  1. _____ A NUMBER variable called v_fixed_amount has been declared (it will remain as a constant once initialized ).

  2. _____ A NUMBER variable called v_fixed_amount has been declared (it will remain as null).

  3. _____ An error message will result because constant initialization must be done in the executable section of the block.

  4. _____ An error message will result because the declaration for the CONSTANT is missing an assignment to a NUMBER.

2)

Which of the following are valid character types for PL/SQL?

  1. _____ Numbers

  2. _____ English letters

  3. _____ Paragraph returns

  4. _____ Arithmetic symbols

  5. _____ Japanese Kanji

3)

A variable may be used for which of the following?

  1. _____ To hold a constant, such as the value of p

  2. _____ To hold the value of a counter that keeps changing

  3. _____ To place a value that will be inserted into the database

  4. _____ To hold onto the function of an operand

  5. _____ To hold any value as long as you declare it

4)

Which of the following will declare a variable that is of the identical data type as the student_id in the database table STUDENT in the CTA database?

  1. _____ v_id student_id := 123;

  2. _____ v_id binary integer;

  3. _____ v_id number NUMBER := 24;

  4. _____ v_id student_id%type;

5)

The value of a variable is set to null after the 'end;' of the block is issued.

  1. _____ True

  2. _____ False


Answers appear in Appendix A, Section 3.1 .



Oracle PL[s]SQL by Example
Oracle PL[s]SQL by Example
ISBN: 3642256902
EAN: N/A
Year: 2003
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net