Neoview Guide to Stored Procedures in Java (R2.5)
B Sample Database
This appendix presents the Sample Database schemas and tables on which the SPJs in this manual
operate:
• “PERSNL Schema” (page 101)
— “JOB Table” (page 101)
— “EMPLOYEE Table” (page 101)
— “DEPT Table” (page 103)
— “PROJECT Table” (page 105)
• “SALES Schema” (page 108)
— “CUSTOMER Table” (page 108)
— “ORDERS Table” (page 109)
— “ODETAIL Table” (page 110)
— “PARTS Table” (page 112)
• “INVENT Schema” (page 113)
— “SUPPLIER Table” (page 113)
— “PARTSUPP Table” (page 114)
— “PARTLOC Table” (page 116)
PERSNL Schema
The PERSNL schema stores employee data.
JOB Table
CREATE TABLE persnl.job (
jobcode NUMERIC (4) UNSIGNED
NO DEFAULT
NOT NULL
,jobdesc VARCHAR (18)
DEFAULT ' '
NOT NULL
,PRIMARY KEY (jobcode)
);
INSERT INTO persnl.job
VALUES ( 100, 'MANAGER' ),
( 200, 'PRODUCTION SUPV' ),
( 250, 'ASSEMBLER' ),
( 300, 'SALESREP' ),
( 400, 'SYSTEM ANALYST' ),
( 420, 'ENGINEER' ),
( 450, 'PROGRAMMER' ),
( 500, 'ACCOUNTANT' ),
( 600, 'ADMINISTRATOR' ),
( 900, 'SECRETARY' );
UPDATE STATISTICS FOR TABLE persnl.job ON EVERY COLUMN;
EMPLOYEE Table
CREATE TABLE persnl.employee (
empnum NUMERIC (4) UNSIGNED
NO DEFAULT
NOT NULL
PERSNL Schema 101