Neoview Guide to Stored Procedures in Java (R2.2)

B Sample Database
This appendix presents the Sample Database schemas and tables on which the SPJs in this manual
operate:
“PERSNL Schema” (page 107)
“JOB Table” (page 107)
“EMPLOYEE Table” (page 107)
“DEPT Table” (page 109)
“PROJECT Table” (page 111)
“SALES Schema” (page 114)
“CUSTOMER Table” (page 114)
“ORDERS Table” (page 115)
“ODETAIL Table” (page 116)
“PARTS Table” (page 118)
“INVENT Schema” (page 119)
“SUPPLIER Table” (page 119)
“PARTSUPP Table” (page 120)
“PARTLOC Table” (page 122)
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 107