O'Reilly logo

Oracle® PL/SQL® Interactive Workbook, Second Edition by Elena Silvestrova, Benjamin Rosenzweig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4 SQL in PLSQL

1)Create a table called CHAP4 with two columns; one is ID (a number) and the second is NAME, which is a varchar2(20).
A1: Answer: Your answer should look similar to the following:
PROMPT Creating Table 'CHAP4' 
 CREATE TABLE chap4 
   (id NUMBER, 
    name VARCHAR2(20)); 
2)Create a sequence called CHAP4_SEQ that increments by units of 5.
A2: Answer: Your answer should look similar to the following:
PROMPT Creating Sequence 'CHAP4_SEQ' 
 CREATE SEQUENCE chap4_seq 
    NOMAXVALUE 
    NOMINVALUE 
    NOCYCLE 
    NOCACHE; 
3)Write a PL/SQL block that performs the following in this order:
  1. Declares 2 variables, one for the v_name and one for v_id. The v_name variable can be used throughout the block for holding the name that will be inserted; realize that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required