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 ...

Get Oracle® PL/SQL® Interactive Workbook, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.