Lab 4.1 Self-Review Questions


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

1)

Which of the following are valid methods to initialize value for a variable?

  1. _____ Declare a sequence

  2. _____ The ":=" syntax

  3. _____ SET SERVEROUTPUT ON

  4. _____ SELECT INTO statement

2)

Which of the following are valid DML or DDL statements in a PL/SQL Block?

  1. _____ INSERT

  2. _____ CREATE TABLE

  3. _____ CREATE SEQUENCE

  4. _____ UPDATE

3)

Complete the following statement with the correct syntax for inserting a sequence in a PL/SQL BLOCK.

 
 INSERT INTO STUDENT (student_id, last_name) 
  1. _____ VALUES (student_id_seq.currval, 'Smith');

  2. _____ VALUES ('Smith', student_id_seq.currval);

  3. _____ VALUES (student_id_seq.nextval, 'Smith');

  4. _____ VALUES (nextval, 'Smith');

4)

Which of the following are true statements about an Oracle sequence?

  1. _____ It can use a DML statement only in stand-alone SQL, not in a PL/SQL block.

  2. _____ It is a database object.

  3. _____ It is useful for generating contiguous numbers for invoicing .

  4. _____ It can be used to generate unique primary keys.


Answers appear in Appendix A, Section 4.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