REM  Copyright (c) 1996, 1997 by Oracle Corporation 
REM
REM    DESCRIPTION
REM      Oracle Developer R6.0 Demonstration script
REM
REM    MODIFIED   (DD-MON-YY)
REM    CZETIE	(27-SEP-96)		Created
REM    CZETIE	(29-JAN-97)		Merged all scripts to one
REM    CZETIE	(26-FEB-97)		Merged Reports, Graphics scripts
REM    CZETIE	(19-MAR-97)		Updated Graphics scripts
REM    CZETIE	(08-MAY-97)		Added Barry's updates
REM    MDORAN     (16-SEP-98)       Add Object Types and Tables
REM    GLIM       (30-SEP-98)       Removed Object Types and Tables
REM    GLIM       (01-OCT-98)       Added Chess, Grid, D2KHelp objects
REM    PNARTH     (06-NOV-98)       Added Newslet table and insert
REM    PGIBERT    (17-FEB-99)       Change the data in the viewdef table
REM    PNARTH     (17-FEB-99)       Changed Newslet data

Prompt Creating and populating Demo schema
Prompt This may take a few minutes...

set termout off
set feedback off
set scan off
set define }
set linesize 1100


REM  Alter the session so that the script will work with
REM  any database

ALTER SESSION SET LANGUAGE='AMERICAN'; 
ALTER SESSION SET TERRITORY='AMERICA'; 
ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YY'; 
ALTER SESSION SET NLS_NUMERIC_CHARACTERS='.,';

REM  Drop any existing objects

DROP TABLE BLOB;
DROP TABLE BONUS;
DROP TABLE COMPANY_SUMMARY;
DROP TABLE DUMMY;
DROP TABLE EMP;
DROP TABLE ITEM;
DROP TABLE ORD;
DROP TABLE ORDPICT;
DROP TABLE PRICE;
DROP TABLE PRODUCT;
DROP TABLE SALGRADE;
DROP TABLE CUSTOMER cascade constraints;
DROP TABLE DEPT cascade constraints;

DROP TABLE CALENDAR_RANGES;
DROP TABLE WORLD_CITIES;
DROP INDEX WC_AIRPORT_CODES;

DROP TABLE TVTABLE;
DROP TABLE FLRPEOPLE;
DROP TABLE USA;
DROP TABLE CITIES;
DROP TABLE SALES_REVENUE;
DROP TABLE STOCK_HISTORY;
DROP TABLE CUSTOMERS;
DROP TABLE PORTFOLIO; 
DROP TABLE STOCKS;
DROP TABLE INDCAT;

DROP TABLE ACCTS;
DROP TABLE ACCT_ADDRS;
DROP TABLE FUNDS; 

DROP TABLE FUND_XACT; 
DROP TABLE FUND_CONTRIB;
DROP TABLE F_XACT_TYPE;
DROP TABLE F_EMPCOMP;

DROP TABLE INVINFO;
DROP TABLE INVREQUEST;

DROP table trivia;
DROP table video_category_by_qtr;

DROP VIEW SALES;

DROP SEQUENCE BLOBID;
DROP SEQUENCE CUSTID;
DROP SEQUENCE ORDID;
DROP SEQUENCE PRODID;

DROP table news_let;

REM **Dropping Chess demo tables
drop table chess_save;
drop table chess_save_boardstate;
drop table chess_save_captured;
drop table chess_save_player;
drop sequence chess_saveID;
drop table game_semaphore;

REM **Dropping Grid tables
drop table    grid_labels;
drop table    viewdef;
drop table    viewdefcol;
drop view     empdept;
drop sequence viewdef_seq;

REM ** Dropping DemoHelp tables
DROP TABLE HELP_KEYWORDS;
DROP TABLE HELP_RELATED;
DROP TABLE FORMS_HELP CASCADE;
DROP TABLE APP_HELP CASCADE;
DROP SEQUENCE SEQ_HELP_ID;
DROP SEQUENCE SEQ_DES2K_APP;



REM Standard tables

CREATE TABLE BLOB(
 BLOB_ID                                  NUMBER CONSTRAINT BLOB_PRIMARY_KEY PRIMARY KEY,
 BLOB_TYPE                                varchar2(30), 
 DESCRIPTION                              varchar2(30),
 BLOB_DATA                                long raw);

REM BLOBS is initially empty

CREATE TABLE COMPANY_SUMMARY(
 COMPANY_ID                               NUMBER,
 COMPANY_NAME                             varchar2(200),
 COMPANY_CEO                              varchar2(200),
 COMPANY_LOCATION                         varchar2(200),
 REVENUE_TO_DATE                          NUMBER,
 COMPANY_LOW                              NUMBER,
 COMPANY_AVG                              NUMBER,
 COMPANY_HI                               NUMBER,
 FILETYPE                                 varchar2(20),
 COMPANY_OLE                              varchar2(200),
 INVEST_RISK                              varchar2(10), 
 COMPANY_DESC                             varchar2(400));


INSERT INTO COMPANY_SUMMARY VALUES (1,'AMR Pharmaceuticals','James Williams','Atlanta, GA',580642134,16,28,36,'spreadsheet','amr.xls','Low','Founded in 1964, AMR Pharmaceuticals has become the leading provider of antibiotic drugs to South America and Asia. We foresee a strong year ahead for AMR in all of its markets, especially internationally.');

INSERT INTO COMPANY_SUMMARY VALUES (2,'California Southern Railway','Paul Gordon','San Francisco, CA',202543196,28,32,38,'slide presentation','csr.ppt','Moderate','In spite of the uncertain economic climate in California, we recommend that investors take a closer look at this well-managed company.');

INSERT INTO COMPANY_SUMMARY VALUES (3,'Boston Resources','Brian Matsumoto','Boston, MA',899143870,11,20,26,'word document','bosfin.doc','High','Due to the large number of insurance claims paid out by this firm due to recent typhoons, investors may want to be cautious here regarding the near term.  However, from the long term perspective, we admire this company for its strong and stable leadership team.' );

CREATE TABLE DEPT (
 DEPTNO              NUMBER(2) CONSTRAINT DEPT_PRIMARY_KEY PRIMARY KEY,
 DNAME               varchar2(14),
 LOC                 varchar2(13));


INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK');
INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
INSERT INTO DEPT VALUES (30,'SALES','CHICAGO');
INSERT INTO DEPT VALUES (40,'OPERATIONS','BOSTON');

CREATE TABLE EMP (
 EMPNO               NUMBER(4) CONSTRAINT EMP_PRIMARY_KEY PRIMARY KEY , 
 ENAME               varchar2(10),
 JOB                 varchar2(9),
 MGR                 NUMBER(4) CONSTRAINT EMP_SELF_KEY REFERENCES EMP (EMPNO),
 HIREDATE            DATE,
 SAL                 NUMBER(7,2),
 COMM                NUMBER(7,2),
 DEPTNO              NUMBER(2) NOT NULL CONSTRAINT EMP_FOREIGN_KEY REFERENCES DEPT (DEPTNO));

 /* disable constraint until we have the data in */
alter table emp disable constraint EMP_SELF_KEY;

INSERT INTO EMP VALUES (7369,'SMITH','CLERK',7902,'17-DEC-80',800,NULL,20);
INSERT INTO EMP VALUES (7499,'ALLEN','SALESMAN',7698,'20-FEB-81',1600,300,30);
INSERT INTO EMP VALUES (7521,'WARD','SALESMAN',7698,'22-FEB-81',1250,500,30);
INSERT INTO EMP VALUES (7566,'JONES','MANAGER',7839,'2-APR-81',2975,NULL,20);
INSERT INTO EMP VALUES (7654,'MARTIN','SALESMAN',7698,'28-SEP-81',1250,1400,30);
INSERT INTO EMP VALUES (7698,'BLAKE','MANAGER',7839,'1-MAY-81',2850,NULL,30);
INSERT INTO EMP VALUES (7782,'CLARK','MANAGER',7839,'9-JUN-81',2450,NULL,10);
INSERT INTO EMP VALUES (7788,'SCOTT','ANALYST',7566,'09-DEC-82',3000,NULL,20);
INSERT INTO EMP VALUES (7839,'KING','PRESIDENT',NULL,'17-NOV-81',5000,NULL,10);
INSERT INTO EMP VALUES (7844,'TURNER','SALESMAN',7698,'8-SEP-81',1500,0,30);
INSERT INTO EMP VALUES (7876,'ADAMS','CLERK',7788,'12-JAN-83',1100,NULL,20);
INSERT INTO EMP VALUES (7900,'JAMES','CLERK',7698,'3-DEC-81',950,NULL,30);
INSERT INTO EMP VALUES (7902,'FORD','ANALYST',7566,'3-DEC-81',3000,NULL,20);
INSERT INTO EMP VALUES (7934,'MILLER','CLERK',7782,'23-JAN-82',1300,NULL,10);

alter table emp enable constraint EMP_SELF_KEY;
  
CREATE TABLE BONUS (
 ENAME               varchar2(10),
 JOB                 varchar2(9),
 SAL                 NUMBER,
 COMM                NUMBER);
 
CREATE TABLE SALGRADE (
 GRADE               NUMBER,
 LOSAL               NUMBER,
 HISAL               NUMBER);
 
INSERT INTO SALGRADE VALUES (1,700,1200);
INSERT INTO SALGRADE VALUES (2,1201,1400);
INSERT INTO SALGRADE VALUES (3,1401,2000);
INSERT INTO SALGRADE VALUES (4,2001,3000);
INSERT INTO SALGRADE VALUES (5,3001,9999);
 
CREATE TABLE DUMMY (
 DUMMY               NUMBER );
 
INSERT INTO DUMMY VALUES (0);
 
CREATE TABLE CUSTOMER (
 CUSTID              NUMBER (6) CONSTRAINT CUSTOMER_PRIMARY_KEY PRIMARY KEY
				CONSTRAINT CUSTID_ZERO CHECK (CUSTID > 0),
 NAME                varchar2 (45),
 ADDRESS             varchar2 (40),
 CITY                varchar2 (30),
 STATE               varchar2 (2),
 ZIP                 varchar2 (9),
 AREA                NUMBER (3),
 PHONE               varchar2 (9),
 REPID               NUMBER (4) NOT NULL,
 CREDITLIMIT         NUMBER (9,2),
 COMMENTS            LONG);

INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
  CITY, AREA, ADDRESS, COMMENTS)
VALUES ('96711', 'CA', '7844', '598-6609', 
 'JOCKSPORTS',
 '100', '5000', 'BELMONT', '415', '345 VIEWRIDGE', 
 'Very friendly people to work with -- sales rep likes to be called Mike.');
 
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT, 
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('94061', 'CA', '7521', '368-1223',
 'TKB SPORT SHOP',
 '101', '10000', 'REDWOOD CITY', '415', '490 BOLI RD.', 
 'Rep called 5/8 about change in order - contact shipping.');
							      
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('95133', 'CA', '7654', '644-3341', 
 'VOLLYRITE',
 '102', '7000', 'BURLINGAME', '415', '9722 HAMILTON', 
 'Company doing heavy promotion beginning 10/89. Prepare for large orders during
 winter.');
 
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT, 
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('97544', 'CA', '7521', '677-9312',
 'JUST TENNIS',
 '103', '3000', 'BURLINGAME', '415', 'HILLVIEW MALL', 
 'Contact rep about new line of tennis rackets.');
							     
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT, 
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('93301', 'CA', '7499', '996-2323',
 'EVERY MOUNTAIN',
 '104', '10000', 'CUPERTINO', '408', '574 SURRY RD.', 
 'Customer with high market share (23%) due to aggressive advertising.');
						      
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT, 
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('91003', 'CA', '7844', '376-9966',
 'K + T SPORTS',
 '105', '5000', 'SANTA CLARA', '408', '3476 EL PASEO', 
 'Tends to order large amounts of merchandise at once. Accounting is considering
 raising their credit limit. Usually pays on time.');
						      
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT, 
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('94301', 'CA', '7521', '364-9777',
 'SHAPE UP',
 '106', '6000', 'PALO ALTO', '415', '908 SEQUOIA', 
 'Support intensive. Orders small amounts (< 800) of merchandise at a time.');
 
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
  CITY, AREA, ADDRESS, COMMENTS)
VALUES ('93301', 'CA', '7499', '967-4398',
 'WOMENS SPORTS',
 '107', '10000', 'SUNNYVALE', '408', 'VALCO VILLAGE', 
 'First sporting goods store geared exclusively towards women. Unusual promotion
al style and very willing to take chances towards new products!');
	    
INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
  CITY, AREA, ADDRESS, COMMENTS) 
VALUES ('55649', 'MN', '7844', '566-9123',
 'NORTH WOODS HEALTH AND FITNESS SUPPLY CENTER',
 '108', '8000', 'HIBBING', '612', '98 LONE PINE WAY', '');

CREATE TABLE ORD  (
 ORDID               NUMBER (4) CONSTRAINT ORD_PRIMARY_KEY PRIMARY KEY,
 ORDERDATE           DATE,
 COMMPLAN            varchar2 (1),
 CUSTID              NUMBER (6) NOT NULL CONSTRAINT ORD_FOREIGN_KEY REFERENCES CUSTOMER (CUSTID),
 SHIPDATE            DATE,
 TOTAL               NUMBER (8,2) CONSTRAINT TOT_ZERO CHECK (TOTAL >= 0));

CREATE TABLE ITEM  (
 ORDID               NUMBER (4) NOT NULL CONSTRAINT ITEM_FOREIGN_KEY REFERENCES ORD (ORDID),
 ITEMID              NUMBER (4) NOT NULL,
 PRODID              NUMBER (6),
 ACTUALPRICE         NUMBER (8,2),
 QTY                 NUMBER (8),
 ITEMTOT             NUMBER (8,2),
 CONSTRAINT ITEM_PRIMARY_KEY PRIMARY KEY (ORDID,ITEMID));
 
CREATE TABLE PRODUCT (
 PRODID              NUMBER (6) CONSTRAINT PRODUCT_PRIMARY_KEY PRIMARY KEY,
 DESCRIP             varchar2 (30));
 
CREATE TABLE PRICE (
 PRODID              NUMBER (6) NOT NULL,
 STDPRICE            NUMBER (8,2),
 MINPRICE            NUMBER (8,2),
 STARTDATE           DATE,
 ENDDATE             DATE);
  
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('101.4', '08-JAN-87', '610', '07-JAN-87', '101', 'A');               
										
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('45', '11-JAN-87', '611', '11-JAN-87', '102', 'B');                 
										
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('5860', '20-JAN-87', '612', '15-JAN-87', '104', 'C');
		   
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('2.4', '30-MAY-86', '601', '01-MAY-86', '106', 'A');
		    
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('56', '20-JUN-86', '602', '05-JUN-86', '102', 'B');
		     
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('698', '30-JUN-86', '604', '15-JUN-86', '106', 'A');
								  
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('8324', '30-JUL-86', '605', '14-JUL-86', '106', 'A');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('3.4', '30-JUL-86', '606', '14-JUL-86', '100', 'A');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('97.5', '15-AUG-86', '609', '01-AUG-86', '100', 'B');
	      
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('5.6', '18-JUL-86', '607', '18-JUL-86', '104', 'C');
			    
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('35.2', '25-JUL-86', '608', '25-JUL-86', '104', 'C');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('224', '05-JUN-86', '603', '05-JUN-86', '102', '');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('4450', '12-MAR-87', '620', '12-MAR-87', '100', '');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('6400', '01-FEB-87', '613', '01-FEB-87', '108', '');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('23940', '05-FEB-87', '614', '01-FEB-87', '102', '');
 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('764', '10-FEB-87', '616', '03-FEB-87', '103', '');
			     
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('1260', '04-FEB-87', '619', '22-FEB-87', '104', '');
			     
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('46370', '03-MAR-87', '617', '05-FEB-87', '105', '');
								   
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('710', '06-FEB-87', '615', '01-FEB-87', '107', '');
							 
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('3510.5', '06-MAR-87', '618', '15-FEB-87', '102', 'A');
								  
INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)     
 VALUES ('730', '01-JAN-87', '621', '15-MAR-87', '100', 'A');
 

INSERT INTO ITEM (QTY, PRODID, ORDID, ITEMTOT, ITEMID, ACTUALPRICE)       
 VALUES ('1', '100890', '610', '58', '3', '58');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '1', '100861', '611', '45', '1', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '100', '100860', '612', '3000', '1', '30');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '1', '200376', '601', '2.4', '1', '2.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '20', '100870', '602', '56', '1', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '3', '100890', '604', '174', '1', '58');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '2', '100861', '604', '84', '2', '42');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '10', '100860', '604', '440', '3', '44');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '4', '100860', '603', '224', '2', '56');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '1', '100860', '610', '35', '1', '35');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '3', '100870', '610', '8.4', '2', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '200', '200376', '613', '440', '4', '2.2');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '444', '100860', '614', '15540', '1', '35');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '1000', '100870', '614', '2800', '2', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '20', '100861', '612', '810', '2', '40.5');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('150', '101863', '612', '1500', '3', '10');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '100860', '620', '350', '1', '35');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1000', '200376', '620', '2400', '2', '2.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('500', '102130', '620', '1700', '3', '3.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ( '100', '100871', '613', '560', '1', '5.6');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('200', '101860', '613', '4800', '2', '24');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('150', '200380', '613', '600', '3', '4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '102130', '619', '340', '3', '3.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('50', '100860', '617', '1750', '1', '35');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '100861', '617', '4500', '2', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1000', '100871', '614', '5600', '3', '5.6');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '100861', '616', '450', '1', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('50', '100870', '616', '140', '2', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('2', '100890', '616', '116', '3', '58');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '102130', '616', '34', '4', '3.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '200376' , '616', '24', '5', '2.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '200380', '619', '400', '1', '4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '200376', '619', '240', '2', '2.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('4', '100861', '615', '180', '1', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1', '100871', '607', '5.6', '1', '5.6');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '100870', '615', '280', '2', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('500', '100870', '617', '1400', '3', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('500', '100871', '617', '2800', '4', '5.6');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('500', '100890', '617', '29000', '5', '58');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '101860', '617', '2400', '6', '24');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('200', '101863', '617', '2500', '7', '12.5');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '102130', '617', '340', '8', '3.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('200', '200376', '617', '480', '9', '2.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('300', '200380', '617', '1200', '10', '4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('5', '100870', '609', '12.5', '2', '2.5');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1', '100890', '609', '50', '3', '50');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('23', '100860', '618', '805', '1', '35');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('50', '100861', '618', '2255.5', '2', '45.11');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '100870', '618', '450', '3', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '100861', '621', '450', '1', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '100870', '621', '280', '2', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('50', '100871', '615', '250', '3', '5');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1', '101860', '608', '24', '1', '24');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('2', '100871', '608', '11.2', '2', '5.6');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1', '100861', '609', '35', '1', '35');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('1', '102130', '606', '3.4', '1', '3.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '100861', '605', '4500', '1', '45');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('500', '100870', '605', '1400', '2', '2.8');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('5', '100890', '605', '290', '3', '58');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('50', '101860', '605', '1200', '4', '24');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '101863', '605', '900', '5', '9');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('10', '102130', '605', '34', '6', '3.4');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('100', '100871', '612', '550', '4', '5.5');
 
INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)       
 VALUES ('50', '100871', '619', '280', '4', '5.6');
 

INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('4.8', '01-JAN-85', '100871', '3.2', '01-DEC-85');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('58', '01-JAN-85', '100890', '46.4', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('54', '01-JUN-84', '100890', '40.5', '31-MAY-84');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('35', '01-JUN-86', '100860', '28', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('32', '01-JAN-86', '100860', '25.6', '31-MAY-86');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('30', '01-JAN-85', '100860', '24', '31-DEC-85');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('45', '01-JUN-86', '100861', '36', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('42', '01-JAN-86', '100861', '33.6', '31-MAY-86');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('39', '01-JAN-85', '100861', '31.2', '31-DEC-85');
		     
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
 VALUES ('2.8', '01-JAN-86', '100870', '2.4', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('2.4', '01-JAN-85', '100870', '1.9', '01-DEC-85');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('5.6', '01-JAN-86', '100871', '4.8', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('24', '15-FEB-85', '101860', '18', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('12.5', '15-FEB-85', '101863', '9.4', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('3.4', '18-AUG-85', '102130', '2.8', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('2.4', '15-NOV-86', '200376', '1.75', '');
 
INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)         
 VALUES ('4', '15-NOV-86', '200380', '3.2', '');
									 
CREATE INDEX PRICE_INDEX ON PRICE(PRODID, STARTDATE);

				  
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('100860', 'ACE TENNIS RACKET I');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('100861', 'ACE TENNIS RACKET II');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('100870', 'ACE TENNIS BALLS-3 PACK');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('100871', 'ACE TENNIS BALLS-6 PACK');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('100890', 'ACE TENNIS NET');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('101860', 'SP TENNIS RACKET');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('101863', 'SP JUNIOR RACKET');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('102130', 'RH: "GUIDE TO TENNIS"');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('200376', 'SB ENERGY BAR-6 PACK');
 
INSERT INTO PRODUCT (PRODID, DESCRIP)                                         
 VALUES ('200380', 'SB VITA SNACK-6 PACK');
 
 
CREATE SEQUENCE BLOBID
INCREMENT BY 1
START WITH 1
NOCACHE;
 
CREATE SEQUENCE CUSTID
INCREMENT BY 1
START WITH 109
NOCACHE;
 
CREATE SEQUENCE ORDID
INCREMENT BY 1
START WITH 622
NOCACHE;
 
CREATE SEQUENCE PRODID
INCREMENT BY 1
START WITH 200381
NOCACHE;
 
CREATE VIEW SALES AS
SELECT REPID, ORD.CUSTID, CUSTOMER.NAME CUSTNAME, PRODUCT.PRODID,
DESCRIP PRODNAME, SUM(ITEMTOT) AMOUNT
FROM ORD, ITEM, CUSTOMER, PRODUCT
WHERE ORD.ORDID = ITEM.ORDID
AND ORD.CUSTID = CUSTOMER.CUSTID
AND ITEM.PRODID = PRODUCT.PRODID
GROUP BY REPID, ORD.CUSTID, NAME, PRODUCT.PRODID, DESCRIP;

CREATE TABLE CUSTOMERS (         ID   NUMBER NOT NULL,
 FIRST_NAME                      varchar2(20) NOT NULL,
 LAST_NAME                       varchar2(20) NOT NULL,
 ADDRESS_LINE_1                           varchar2(30),
 ADDRESS_LINE_2                           varchar2(30),
 ADDRESS_LINE_3                           varchar2(30),
 PHONE_NUMBER                             varchar2(15),
 FAX_NUMBER                               varchar2(15) NOT NULL,
 COMM_PAID_YTD                            NUMBER(9,2) NOT NULL,
 ACCOUNT_BALANCE                          NUMBER(9,2) NOT NULL,
 COMMENTS                                 varchar2(240));


insert into customers values (10,'Natarajan', 'Iyer', '9994 Foster Street', 'Foster City, CA 90003',
    NULL,'415-506-5001','415-506-3999',0,90000, NULL);                
												    
insert into customers values (20,'Mike', 'Kanaley', '9989 Cross Street', 'Bealville, CA 90006', 
NULL, '415-506-5002', '415-506-3998', 0,80000, NULL );
												    
insert into customers values (30, 'Holway', 'Kalikow', '9984 Eye Street', 'Caliente, CA 90009', 
NULL, '415-506-5003', '415-506-3997', 0, 70000, NULL );                
												    
insert into customers values (40, 'Earl', 'Blair', '9979 Colson Blvd.', 'Mojave, CA 90012', 
NULL, '415-506-5004 ', '415-506-3996', 0, 60000, NULL );
												    
insert into customers values (50, 'Alvin', 'Law', '9974 Walker Street', 'Tehachapi, CA 90015', 
NULL, '415-506-5005', '415-506-3995', 0, 50000, NULL );
												    
insert into customers values (60, 'Charles', 'Weiss', '869 Ulloa Street', 'Redwood City, CA 90018', 
NULL, '415-506-5006', '415-506-3994', 0, 40000, NULL );
												    
insert into customers values (70, 'Vincent', 'Morello', '9964 Santa Fe Avenue', 'Albany, CA 90021', 
NULL, '415-506-5007', '415-506-3993', 0, 30000, NULL );
												    
insert into customers values (90, 'Clifford', 'Godwin', '9884 Sixth Street', 'Berkeley, CA 90069', 
NULL, '415-506-5023', '415-506-3977', 0, 70000, NULL );
												    
insert into customers values (100, 'Jagdish', 'Pamnani', '9879 Detail Way', 'San Luis Obispo, CA 98072', 
NULL, '415-506-5024', '415-506-3976', 0, 60000, NULL );

insert into customers values (110, 'Leonard', 'Towle', '23 Western Avenue', 'Moapa, NV 89943', 
NULL, '415-506-5025', '415-506-3975',0, 50000, NULL);

insert into customers values (120, 'Ben', 'King', '8320 Helper Blvd.', 'Bakersfield, CA 90078', 
NULL, '415-506-5026', '415-506-3974', 0, 40000, NULL);
												    
insert into customers values (130, 'Maryam', 'Saffari', '9864 Milwaukee Ave.' ,'Minot, SD 65601', 
NULL, '415-506-5027', '415-506-3973', 0, 30000, NULL);                  
												    
insert into customers values (140, 'Arturo', 'Zacarias', '9859 Picasso Street', 'Havre, MT 66184', 
NULL, '415-506-5028', '415-506-3972',0, 20000, NULL);
												    
insert into customers values (80, 'Tim', 'Jones', '2380 Sunset Boulevard', 'San Francisco, CA 94109',
NULL,'415-898-5363', '415-898-5334', 23400, 12300,                 
'Tim prefers to trade in NASDAQ stock.');
												    
CREATE TABLE ORDPICT  (
  ORDID               NUMBER (4) NOT NULL,
  ORDERDATE           DATE,
  COMMPLAN            CHAR (1),
  CUSTID              NUMBER (6) NOT NULL,
  SHIPDATE            DATE,
  TOTAL               NUMBER (8,2),
  CARDS               VARCHAR2 (40));

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('101.4', '07-JAN-87', '610', '08-JAN-87', '101', 'A', 'tkbsport.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('45', '11-JAN-87', '611', '11-JAN-87', '102', 'B', 'volyrite.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('5860', '15-JAN-87', '612', '20-JAN-87', '104', 'C', 'evrymntn.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('2.4', '01-MAY-86', '601', '30-MAY-86', '106', 'A', 'shapeup.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('56', '05-JUN-86', '602', '20-JUN-86', '102', 'B', 'volyrite.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('698', '15-JUN-86', '604', '30-JUN-86', '106', 'A', 'shapeup.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('8324', '14-JUL-86', '605', '30-JUL-86', '106', 'A', 'shapeup.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('3.4', '14-JUL-86', '606', '30-JUL-86', '100', 'A', 'jockspor.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('97.5', '01-AUG-86', '609', '15-AUG-86', '100', 'B', 'jockspor.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('5.6', '18-JUL-86', '607', '18-JUL-86', '104', 'C', 'evrymntn.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('35.2', '25-JUL-86', '608', '25-JUL-86', '104', 'C', 'evrymntn.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('224', '05-JUN-86', '603', '05-JUN-86', '102', '', 'volyrite.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('4450', '12-MAR-87', '620', '12-MAR-87', '100', '', 'jockspor.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('6400', '01-FEB-87', '613', '01-FEB-87', '108', '', 'nrthwood.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('23940', '01-FEB-87', '614', '05-FEB-87', '102', '', 'volyrite.tif');
 
INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('764', '03-FEB-87', '616', '10-FEB-87', '103', '', 'justenn.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('1260', '04-FEB-87', '619', '22-FEB-87', '104', '', 'evrymntn.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('46370', '05-FEB-87', '617', '03-MAR-87', '105', '', 'ktsports.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('710', '01-FEB-87', '615', '06-FEB-87', '107', '', 'womnsprt.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('3510.5', '15-FEB-87', '618', '06-MAR-87', '102', 'A', 'volyrite.tif');

INSERT INTO ORDPICT (TOTAL, ORDERDATE, ORDID, SHIPDATE, CUSTID, COMMPLAN, CARDS)
  VALUES ('730', '01-JAN-87', '621', '15-MAR-87', '100', 'A', 'jockspor.tif');

CREATE INDEX ORDPICT_INDEX ON ORDPICT(ORDID);

COMMIT;

REM Package procedures for block based on stored procedure

create or replace PACKAGE EmpDeptP AS
  type emp_dname is record( 
    empno 		number(4), 
    job		varchar2(9),
    hiredate	date, 
    deptno		number(2),
    dname		varchar2(14)); 

  type emp_dname_ref is ref cursor return emp_dname; 
  type emp_dname_tab is table of emp_dname index by binary_integer; 

  procedure query  (resultset in out emp_dname_ref); 

  procedure plock  (dmlset in out emp_dname_tab);
  procedure pinsert(dmlset in out emp_dname_tab);
  procedure pupdate(dmlset in out emp_dname_tab);
  procedure pdelete(dmlset in out emp_dname_tab);
  
END;
/
create or replace PACKAGE BODY EmpDeptP AS

  procedure query(resultset in out emp_dname_ref) is 
  begin 
    open resultset for 
       select e.empno, e.job, e.hiredate, e.deptno, d.dname 
       from emp e, dept d
       where e.deptno = d.deptno; 
  end; 

  procedure plock(dmlset in out emp_dname_tab) is
  begin
--lock the specified record
     null;
  end;

  procedure pinsert(dmlset in out emp_dname_tab) is
  begin
--insert the records from the table of records
     null;
  end;

  procedure pupdate(dmlset in out emp_dname_tab) is
  begin
--update the records from the table of records
     null;
  end;

  procedure pdelete(dmlset in out emp_dname_tab) is
  begin
--delete  the records from the table of records
     null;
  end;


END;
/

REM workaround for 7.3.2 and earlier timestamp problem

alter package empdeptp 
compile timestamp '1997-01-01:00:00:00';

REM The drag 'n' drop trivia questions

create table trivia
(  id         number(4),
   question   varchar2(150),
   answer     varchar2(50)
)
/
insert into trivia values (1,'What size pumps did cross-dressing Corporal Max Klinger wear on the TV sitcom M*A*S*H?','10');
insert into trivia values (2,'What is the distance between bases on a Little League baseball field?','60 feet');
insert into trivia values (3,'What is the meaning of the musical direction "estinto"?','As soft as possible');
insert into trivia values (4,'Who was the only American president to graduate from the U.S. Naval Academy?','Jimmy Carter');
insert into trivia values (5,'Who was the first sports great to have his number retired by his team?','Lou Gehrig');
insert into trivia values (6,'What California city is directly across the border from the Mexican city of Mexicali - and has a name to match it?','Calexico');
insert into trivia values (7,'What nation was the first to use frogmen in warfare?','Italy');
insert into trivia values (8,'What plant''s name - derived from the French - means "lion''s tooth"?','The dandelion');
insert into trivia values (9,'What 1988 film ends with 763 names - the longest list of credits on record?','Who Framed Roger Rabbit?');
insert into trivia values (10,'In the folk tale about Rumpelstiltskin, how lond did it take the miller''s daughers to guess his name?','Three days');
insert into trivia values (11,'What wind speed does a storm have to exceed to be given a name by the National Hurricane Center?','39 mph');
insert into trivia values (12,'What does the word "koala" mean in Australia''s Aborigine language?','No Drink');
insert into trivia values (13,'What is the Canadian equivalent of the Emmy?','The Nelly');
insert into trivia values (14,'What singer has recorded under the alias Apollo C. Vermouth?','Paul McCartney');
insert into trivia values (15,'What is the only land mammal native to New Zealand?','The bat');
insert into trivia values (16,'Who was the only president born in Illinois, the Land of Lincoln?','Ronald Reagan');
insert into trivia values (17,'To what famous actress did Winston Churchill propose marriage?','Ethel Barrymore');
insert into trivia values (18,'What Ivy League college was the last to go coed?','Dartmouth');
insert into trivia values (19,'What was Henry Ford''s first mass-produced car?','The Model N');
insert into trivia values (20,'What famous play begins with the line, "Who''s there?"','Hamlet');
insert into trivia values (21,'What percent of a newly minted dime is silver?','None');
insert into trivia values (22,'To what lodge do Fred and Barney of TV''s "The Flintstones" belong?','The Loyal Order of Water Buffaloes');
insert into trivia values (23,'What famous circus performer introduced the flying trapeze?','Jules Leotard');
insert into trivia values (24,'What Japanese company made the famous Zero fighter plane during World War II?','Mitsubishi');
insert into trivia values (25,'What American industry introduced the 5-day 40-hour work week?','Steel');
insert into trivia values (26,'How many vertebrae does a human being have?','33');
insert into trivia values (27,'Which European country has two elements on the Periodic Table named after it?','France');
insert into trivia values (28,'What drink is named for the wormwood plant?','Vermouth');
insert into trivia values (29,'According to Norse legend, which animals pulled Thor''s chariot across the sky?','Two goats');
insert into trivia values (30,'Which was the only Alfred Hitchcock film to win an Academy Award for Best Picture?','Rebecca');
insert into trivia values (31,'What sport was the first to be filmed, and who filmed it?','Boxing by Thomas Edison');
insert into trivia values (32,'What animal is believed to have the best hearing?','The Barn Owl');
insert into trivia values (33,'For what famous historic figure was Marietta, Ohio named?','Marie Antoinette');
insert into trivia values (34,'Where is Rock English spoken?','Gibraltar');
insert into trivia values (35,'What was the first human organ to be successfully transplanted?','The Kidney');
insert into trivia values (36,'What is the diameter of a compact disc which can hold up to three miles of playing track?','4.75 inches');
insert into trivia values (37,'What famous Englishman gave us the expression, "Keep your powder dry"?','Oliver Cromwell');
insert into trivia values (38,'What name did George Washington use in addressing his friend the Marquis de Lafayette?','Fayette');
insert into trivia values (39,'Where in the world is there a place called Disko Island?','Greenland');
insert into trivia values (40,'What is the "lead" in a lead pencil?','Graphite');
insert into trivia values (41,'What is brontology the study of?','Thunder');
insert into trivia values (42,'By what popular name do we know the fluorine-based compound polytetrafluoro-ethylene, or PTFE?','Teflon');
insert into trivia values (43,'How long - in days - did the Pilgrims'' first Thanksgiving in 1621 last?','Three');
insert into trivia values (44,'What recreational activity did Joseph Merlin of Belgium demonstrate for the first time in 1760 at a London masquerade party?','Roller Skating');
insert into trivia values (45,'How many toes does a giraffe have on each foot?','Two');
insert into trivia values (46,'Mae West once said she liked two kinds of men.  What were they?','Domestic and Foreign');
insert into trivia values (47,'What great thinker proved a lunar eclipse is the circular shadow of the earth on the moon?','Aristotle');
insert into trivia values (48,'What was the first sport in which women were invited to compete in the Olympics?','Tennis');
insert into trivia values (49,'Where are a butterfly''s tastebuds located?','Legs');
insert into trivia values (50,'In what Cary Grant film is a tombstone shown inscribed with his real name - Archibald Leach?','Arsenic and Old Lace');
insert into trivia values (51,'What card game gave us the term "bilk"?','Cribbage');
insert into trivia values (52,'What popular dog was originally known as a waterside terrier?','Airdale');
insert into trivia values (53,'In England, what is the hobby of people known as "twitchers"?','Bird watching');
insert into trivia values (54,'How much was suffragette Susan B. Anthony fined for voting in the 1872?','$100');
insert into trivia values (55,'What was Dr. Frankenstein''s first name in the Mary Shelley horror classic?','Victor');
insert into trivia values (56,'How many times does a newly produced U.S. dollar bill have to go through the printing press?','Three');
insert into trivia values (57,'How many members did the United Nations have when it celebrated its 50th anniversary in 1995?','185');
insert into trivia values (58,'What are you afraid of if you have siderodromophobia?','Trains');
insert into trivia values (59,'On what vegtable did an ancient Egyptian place his right hand when taking an oath?','Onion');
insert into trivia values (60,'How many kinds of kisses are described in the Kama Sutra, the classical Indian text on eroticism?','Twenty');
commit;


REM *** Begin Oracle Graphics Requirements ***

Create Table CALENDAR_RANGES
(
 month_year	VarChar2(6)	NOT NULL,
 Range_name	VarChar2(50)	NOT NULL,
 Start_date	Date		NOT NULL,
 End_date	Date		NOT NULL,
 Priority	Number		NOT NULL
);

INSERT INTO CALENDAR_RANGES VALUES ( 'AUG-97', 'High Priority',   '01-AUG-97', '03-AUG-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'DEC-96', 'High Priority',   '01-DEC-96', '03-DEC-96', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'FEB-97', 'High Priority',   '01-FEB-97', '03-FEB-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JAN-97', 'High Priority',   '01-JAN-97', '03-JAN-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUL-97', 'High Priority',   '01-JUL-97', '03-JUL-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUN-97', 'High Priority',   '01-JUN-97', '03-JUN-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAR-97', 'High Priority',   '01-MAR-97', '03-MAR-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'OCT-97', 'High Priority',   '01-OCT-97', '03-OCT-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'SEP-97', 'High Priority',   '01-SEP-97', '03-SEP-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'APR-97', 'High Priority',   '02-APR-97', '05-APR-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'APR-97', 'Low Priority 2',  '10-APR-97', '11-APR-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'AUG-97', 'Medium Priority', '10-AUG-97', '12-AUG-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'DEC-96', 'Medium Priority', '10-DEC-96', '12-DEC-96', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'FEB-97', 'Medium Priority', '10-FEB-97', '12-FEB-97', 2 );                              
INSERT INTO CALENDAR_RANGES VALUES ( 'JAN-97', 'Medium Priority', '10-JAN-97', '12-JAN-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUL-97', 'Medium Priority', '10-JUL-97', '12-JUL-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUN-97', 'Medium Priority', '10-JUN-97', '12-JUN-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAR-97', 'Medium Priority', '10-MAR-97', '12-MAR-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAY-97', 'Medium Priority', '10-MAY-97', '12-MAY-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'OCT-97', 'Medium Priority', '10-OCT-97', '12-OCT-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'SEP-97', 'Medium Priority', '10-SEP-97', '12-SEP-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'APR-97', 'Medium Priority', '15-APR-97', '17-APR-97', 2 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'AUG-97', 'Low Priority 2',  '15-AUG-97', '16-AUG-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'DEC-96', 'Low Priority 2',  '15-DEC-97', '16-DEC-96', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'FEB-97', 'Low Priority 2',  '15-FEB-97', '16-FEB-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JAN-97', 'Low Priority 2',  '15-JAN-97', '16-JAN-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUL-97', 'Low Priority 2',  '15-JUL-97', '16-JUL-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUN-97', 'Low Priority 2',  '15-JUN-97', '16-JUN-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAR-97', 'Low Priority 2',  '15-MAR-97', '16-MAR-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAY-97', 'Low Priority 2',  '15-MAY-97', '16-MAY-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'OCT-97', 'Low Priority 2',  '15-OCT-97', '16-OCT-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'SEP-97', 'Low Priority 2',  '15-SEP-97', '16-SEP-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAY-97', 'High Priority',   '20-MAY-97', '03-MAY-97', 1 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'AUG-97', 'Low Priority 1',  '21-AUG-97', '25-AUG-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'DEC-96', 'Low Priority 1',  '21-DEC-96', '25-DEC-96', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'FEB-97', 'Low Priority 1',  '21-FEB-97', '25-FEB-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JAN-97', 'Low Priority 1',  '21-JAN-97', '25-JAN-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUL-97', 'Low Priority 1',  '21-JUL-97', '25-JUL-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'JUN-97', 'Low Priority 1',  '21-JUN-97', '25-JUN-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAR-97', 'Low Priority 1',  '21-MAR-97', '25-MAR-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'MAY-97', 'Low Priority 1',  '21-MAY-97', '25-MAY-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'OCT-97', 'Low Priority 1',  '21-OCT-97', '25-OCT-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'SEP-97', 'Low Priority 1',  '21-SEP-97', '25-SEP-97', 3 );                               
INSERT INTO CALENDAR_RANGES VALUES ( 'APR-97', 'Low Priority 1',  '26-APR-97', '27-APR-97', 3 );


REM **********************************************
REM InsertMapData.SQL - Data for Map Widget demo
REM **********************************************

CREATE TABLE WORLD_CITIES
(
LOCATION_ID		NUMBER		NOT NULL
PRIMARY KEY,
CITY			VARCHAR2(30),
STATE			VARCHAR2(20),
COUNTRY			VARCHAR2(30),
AIRPORT_CODE		VARCHAR2(5)	NOT NULL,
POPULATION		NUMBER,
MULTI_SITE_LOCATION	VARCHAR2(1)
);

CREATE UNIQUE INDEX WC_AIRPORT_CODES
ON WORLD_CITIES(AIRPORT_CODE);


insert into world_cities values (   1,'Redwood Shores',       'California',           'United States Of America',    'SQL',    100000,'');  
insert into world_cities values (   2,'Seattle',              'Washington',           'United States Of America',    'SEA',    100000,'');  
insert into world_cities values (   3,'London',               '',                     'United Kingdom',              'LHR',    100000,'');  
insert into world_cities values (   4,'Bracknel',             'Berkshire',            'United Kingdom',              'GTW',    100000,'');  
insert into world_cities values (   5,'Sydney',               'New South Wales',      'Australia',                   'SYD',    100000,'');  
insert into world_cities values (   6,'Hong Kong',            '',                     'Hong Kong',                   'HKK',    230000,'');  
insert into world_cities values (   7,'Singapore',            '',                     'Singapore',                   'SIN',    100000,'');  
insert into world_cities values (   8,'Los Angeles',          'California',           'United States Of America',    'LAX',    100000,'');  
insert into world_cities values (   9,'New York',             'New York',             'United States Of America',    'JFK',    100000,'');  
insert into world_cities values (  10,'Melbourne',            'Victoria',             'Australia',                   'MEL',    100000,'');  
insert into world_cities values (  11,'Perth',                'Western Australia',    'Australia',                   'PER',    100000,'');  
insert into world_cities values (  12,'Harare',               '',                     'Zimbabwe',                    'HAR',    100000,'');  
insert into world_cities values (  13,'Washington DC',        'District Of Columbia', 'United States Of America',    'WDA',    100000,'');  
insert into world_cities values (  14,'Amstemdam',            '',                     'Holland',                     'SHP',    100000,'');  
insert into world_cities values (  15,'Brisbane',             'Queensland',           'Australia',                   'BNE',    100000,'');  
insert into world_cities values (  16,'Tokyo',                '',                     'Japan',                       'TYO',    100000,'');  
insert into world_cities values (  17,'Kuala Lumpur',         'Selangor',             'Malaysia',                    'KUL',    100000,'');  
insert into world_cities values (  18,'Auckland',             '',                     'New Zealand',                 'AUK',    100000,'');  
insert into world_cities values (  19,'Moscow',               '',                     'Russia',                      'MCW',    100000,'');  
insert into world_cities values (  20,'Buenos Aires',         '',                     'Argentina',                   'BNS',    100000,'');  
insert into world_cities values (  21,'Rio De Jenerio',       '',                     'Brazil',                      'RDJ',    100000,'');  
insert into world_cities values (  22,'Denpasar',             'Bali',                 'Indonesia',                   'DPS',    100000,'');  
insert into world_cities values (  23,'Seoul',                '',                     'Korea',                       'SEL',    100000,'');  
insert into world_cities values (  24,'Lima',                 '',                     'Peru',                        'LMA',    100000,'');  
insert into world_cities values (  25,'La Paz',               '',                     'Bolivia',                     'LPZ',    100000,'');  
insert into world_cities values (  26,'Istanbul',             '',                     'Turkey',                      'ISB',    100000,'');  
insert into world_cities values (  27,'San Tiago',            '',                     'Chile',                       'SNT',    100000,'');  
insert into world_cities values (  28,'Minneaspolis-St Paul', 'Minnasota',            'United States Of America',    'MPL',    100000,'');  
insert into world_cities values (  29,'St Louis',             '',                     'United States Of America',    'STL',    100000,'');  
insert into world_cities values (  30,'Roma',                 '',                     'Italy',                       'RMA',    100000,'');  
insert into world_cities values (  31,'Nairobi',              '',                     'Kenya',                       'NBO',    100000,'');  
insert into world_cities values (  32,'Wellington',           '',                     'New Zealand',                 'WEL',    100000,'');  
insert into world_cities values (  33,'New Delhi',            '',                     'India',                       'NDL',    100000,'');  
insert into world_cities values (  34,'Madrid',               '',                     'Spain',                       'MAD',    100000,'');  
insert into world_cities values (  35,'Bangkok',              '',                     'Thailand',                    'BKK',    100000,'');  
insert into world_cities values (  36,'Athens',               '',                     'Greece',                      'ATH',    100000,'');  
insert into world_cities values (  37,'Mexico City',          '',                     'Mexico',                      'MEX',    100000,'');  
insert into world_cities values (  38,'Paris',                '',                     'France',                      'CDG',    100000,'');  
insert into world_cities values (  39,'Panama City',          '',                     'Panama',                      'PAN',    100000,'');  
insert into world_cities values (  40,'Bogata',               '',                     'Columbia',                    'BOG',    100000,'');  
insert into world_cities values (  41,'Havana',               '',                     'Cuba',                        'HVA',    100000,'');  
insert into world_cities values (  42,'Copenhagen',           '',                     'Denmark',                     'CPH',    100000,'');  
insert into world_cities values (  43,'Bombay',               '',                     'India',                       'BMY',    100000,'');  
insert into world_cities values (  44,'Manila',               '',                     'Philipines',                  'MNL',    100000,'');  
insert into world_cities values (  45,'Port Moresby',         '',                     'Papua New Guinea',            'PMB',    100000,'');  
insert into world_cities values (  46,'Rockhampton',          'Queensland',           'Australia',                   'RKH',    100000,'');  
insert into world_cities values (  47,'San Francisco',        'California',           'United States Of America',    'SFO',    100000,'');  
insert into world_cities values (  48,'Darwin',               'Northern Territory',   'Australia',                   'DWN',    100000,'');  
insert into world_cities values (  49,'Honolulu',             'Hawaii',               'United States Of America',    'HNL',    100000,'');  
insert into world_cities values (  50,'Frankfurt',            'Mainz-Freiburg',       'Federal Republic Of Germany', 'FNT',    100000,'');  
insert into world_cities values (  51,'Johannesburg',         '',                     'Republic of South Africa',    'JBG',    100000,'');  
insert into world_cities values (  52,'Chicago',              'Illinois',             'United States Of America',    'CHG',    100000,'');  
insert into world_cities values (  53,'Miami',                'Florida',              'United States Of America',    'MIA',    100000,'');  
insert into world_cities values (  54,'Dallas',               'Texas',                'United States Of America',    'DFW',    100000,'');  
insert into world_cities values (  55,'Beijing',              '',                     'Peoples Republic Of China',   'BJG',    100000,'');  
insert into world_cities values (  56,'Bay Area',             'California',           'United States Of America',    'SFB',    100000,'Y'); 
insert into world_cities values (  57,'Vancover',             'British Columbia',     'Canada',                      'VAN',    100000,'');  
insert into world_cities values (  58,'Toronto',              'Ontario',              'Canada',                      'TRT',    100000,'');  
insert into world_cities values (  59,'San Jose',             'California',           'United States Of America',    'SJE',    100000,'');  
insert into world_cities values (  60,'Cancun',               'Yucatan',              'Mexico',                      'CUN',    100000,'');  
insert into world_cities values (  61,'Munich',               'Barvaria',             'Federal Republic Of Germany', 'MUN',    100000,'');  
insert into world_cities values (  62,'Jakarta',              'West Java',            'Indonesia',                   'CGK',    100000,'');  
insert into world_cities values (  63,'Cairo',                '',                     'Egypt',                       'CAI',    104000,'');  
insert into world_cities values (  64,'Tel Aviv',             '',                     'Isreal',                      'TLV',    100000,'');  
insert into world_cities values (  65,'Tehran',               '',                     'Iran',                        'THR',    100000,'');  
insert into world_cities values (  66,'Jeddah',               '',                     'Saudi Arabia',                'JED',    100000,'');  
insert into world_cities values (  67,'Riyadh',               '',                     'Saudi Arabia',                'RYH',    100000,'');  
insert into world_cities values (  68,'Bahrain',              '',                     'Bahrain',                     'BAH',    100000,'');  


create table tvtable(
   tvno number PRIMARY KEY,
   channel number,
   program varchar2(80),
   program_abrv varchar2(10),
   starttime date,
   endtime date,
   subj   varchar2(2000)
);

insert into tvtable values(1, 2, 'Seinfeld', 'SFD', to_date('11-FEB-97 17:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 18:00:00','DD-MON-YY HH24:MI:SS'),'This is an interesting comedy. Excellent');
insert into tvtable values(2, 2, 'NOVA', 'NOV', to_date('11-FEB-97 18:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'),'Science Program. Origins of the Universe.');
insert into tvtable values(3, 2, 'Mystery', 'MYS', to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 20:00:00','DD-MON-YY HH24:MI:SS'),'Prime Suspect 4. Real thriller');
insert into tvtable values(4, 2, 'Home Time', 'HTM', to_date('11-FEB-97 20:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 21:00:00','DD-MON-YY HH24:MI:SS'),'How to install hardwood flooring');
insert into tvtable values(5, 2, 'Star Trek', 'STT', to_date('11-FEB-97 21:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 22:00:00','DD-MON-YY HH24:MI:SS'),'Captain Kirk saves Spock');
insert into tvtable values(6, 4, 'Babylon 5', 'BB5', to_date('11-FEB-97 17:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 18:30:00','DD-MON-YY HH24:MI:SS'),'Inter-galatical relations are tense. Strange');
insert into tvtable values(7, 4, 'Late Show', 'LSH', to_date('11-FEB-97 18:30:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 20:30:00','DD-MON-YY HH24:MI:SS'),'Summer of 42. Oldie but goodie.');
insert into tvtable values(8, 4, 'Arsenio', 'ARS', to_date('11-FEB-97 20:30:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 22:00:00','DD-MON-YY HH24:MI:SS'),'Eddie Murphy and Brooke Shields are guest');
insert into tvtable values(9, 4, 'Firing Line', 'FLI', to_date('11-FEB-97 22:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 23:30:00','DD-MON-YY HH24:MI:SS'),'Conservative news commentary');
insert into tvtable values(10, 4, 'Travels', 'TRA', to_date('11-FEB-97 23:30:00','DD-MON-YY HH24:MI:SS'), to_date('12-FEB-97 01:00:00','DD-MON-YY HH24:MI:SS'),'Back streets of London');
insert into tvtable values(11, 7, 'Yan Can Cook', 'YCC', to_date('11-FEB-97 17:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 18:00:00','DD-MON-YY HH24:MI:SS'),'Chinese cooking at its best');
insert into tvtable values(12, 7, 'This Old House', 'TOH', to_date('11-FEB-97 18:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'),'Remodeling old victorian');
insert into tvtable values(13, 7, 'NBA Chi vs OAK', 'NBA', to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 21:30:00','DD-MON-YY HH24:MI:SS'),'Who do you think will win?');
insert into tvtable values(14, 7, 'TBS Sports', 'TBS', to_date('11-FEB-97 21:30:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 23:00:00','DD-MON-YY HH24:MI:SS'),'Slalom skiing championship at Vail');
insert into tvtable values(15, 7, 'UCLA vs USC', 'CBB', to_date('11-FEB-97 23:00:00','DD-MON-YY HH24:MI:SS'), to_date('12-FEB-97 01:00:00','DD-MON-YY HH24:MI:SS'),'Great matchup');
insert into tvtable values(16, 9, 'Women''s Tennis', 'WTS', to_date('11-FEB-97 17:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'),'The top four women compete');
insert into tvtable values(17, 9, 'Golf', 'GOL', to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 21:00:00','DD-MON-YY HH24:MI:SS'),'AT+T Open');
insert into tvtable values(18, 9, 'ABC News', 'ANE', to_date('11-FEB-97 21:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 22:00:00','DD-MON-YY HH24:MI:SS'),'News feature articles');
insert into tvtable values(19, 9, '60 Minutes', '60M', to_date('11-FEB-97 22:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 23:00:00','DD-MON-YY HH24:MI:SS'),'Corruption in government');
insert into tvtable values(20, 9, 'Movie: E.T.', 'ET-', to_date('11-FEB-97 23:00:00','DD-MON-YY HH24:MI:SS'), to_date('12-FEB-97 01:00:00','DD-MON-YY HH24:MI:SS'),'Extraterrestrial drama. Excellent');
insert into tvtable values(21, 33, 'Physics 101', 'EDU', to_date('11-FEB-97 18:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'),'Study in mechanics');
insert into tvtable values(22, 33, 'Court TV', 'CTV', to_date('11-FEB-97 19:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 20:00:00','DD-MON-YY HH24:MI:SS'),'Double murder trial');
insert into tvtable values(23, 33, 'X Files', 'ETT', to_date('11-FEB-97 20:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 21:00:00','DD-MON-YY HH24:MI:SS'),'Weird, but interesting.');
insert into tvtable values(24, 33, 'Home Shopping', 'HSP', to_date('11-FEB-97 21:00:00','DD-MON-YY HH24:MI:SS'), to_date('11-FEB-97 22:45:00','DD-MON-YY HH24:MI:SS'),'Wait until you see what they are selling.');
insert into tvtable values(25, 33, 'Fitness Show', 'FTN', to_date('11-FEB-97 22:45:00','DD-MON-YY HH24:MI:SS'), to_date('12-FEB-97 00:00:00','DD-MON-YY HH24:MI:SS'),'Back exercises');

create table flrpeople (
   FIRST_NAME			VARCHAR2(20),
   LAST_NAME			VARCHAR2(40) NOT NULL,
   DATE_OF_BIRTH			VARCHAR2(6),
   WORK_TELEPHONE			VARCHAR2(60),
   USERID				VARCHAR2(240),
   EMPLOYEE_NUMBER		VARCHAR2(30),
   LOCATION_CODE			VARCHAR2(30),
   TITLE				VARCHAR2(150),
   ATTRIBUTE2			VARCHAR2(150)
);

insert into flrpeople values ('Linda', 'Smith', '01-FEB', '415 555-4189', 'LISMITH', '10781', 'OP200-8-845', 'QA Engineer', 'Decision Support Systems');
insert into flrpeople values ('Brian', 'Allen', '10-OCT', '415 555 1216', 'BRALLEN', '19240', 'OP200-8-834', 'Principal Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Irena', 'Ward', '01-FEB', '415 555-1444', 'IRWARD', '7275', 'OP200-8-856A', 'Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Michael', 'Jones', '17-FEB', '415 555 0534', 'MIJONES', '10426', 'OP200-8-838A', 'Product Project Leader', 'Decision Support Systems');
insert into flrpeople values ('Christina', 'Martin', '01-FEB', '415 555 7324', 'CHMARTIN', '13524', 'OP200-8-838B', 'Product Manager', 'Decision Support Systems');
insert into flrpeople values ('Steven', 'Blake', '01-FEB', '415 555-3859', 'STBLAKE', '19774', 'OP200-8-836', 'DSS Development', 'Decision Support Systems');
insert into flrpeople values ('Helen', 'Clark', '01-FEB', '415 555-6480', 'HECLARK', '12895', 'OP200-8-842', 'Product Manager', 'Decision Support Systems');
insert into flrpeople values ('Darren', 'Scott', '25-DEC', '415 555 1413', 'DASCOTT', '16074', 'OP200-8-844', 'Senior Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Prakoon', 'King', '03-MAY', '415 555 6153', 'PRKING', '7910', 'OP200-8-848', 'Principal Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Akin', 'Turner', '17-MAY', '415 555-8106', 'AKTURNER', '7981', 'OP200-8-846', 'Project Lead', 'Decision Support Systems');
insert into flrpeople values ('Randall', 'Adams', '16-AUG', '415 555 8143', 'RAADAMS', '9456', 'OP200-8-852', 'Project Lead', 'Decision Support Systems');
insert into flrpeople values ('Raghuram', 'James', '21-JAN', '415 555-5482', 'RAJAMES', '23313', 'OP200-8-851', 'Member of Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Linda', 'Ford', '01-FEB', '415 555 8996', 'LIFORD', '24435', 'OP200-8-843', 'Quality Assurance Engineer', 'Decision Support Systems');
insert into flrpeople values ('Jeffrey', 'Miller', '01-FEB', '415 555-5863', 'JEMILLER', '20393', 'OP200-8-850', 'Senior Member of Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Zheng', 'Smith', '11-MAR', '415 555 6915', 'ZHSMITH', '22721', 'OP200-8-841', 'Member of Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Leslie', 'Allen', '15-JAN', '415 555 7264', 'LEALLEN', '4617', 'OP200-8-840', 'Product Manager', 'Decision Support Systems');
insert into flrpeople values ('Harshad', 'Ward', '01-JAN', '415 555 6414', 'HAWARD', '18395', 'OP200-8-855', 'Senior Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Elisabeth', 'Jones', '22-OCT', '415 555 3485', 'ELJONES', '28453', 'OP200-8-855', 'Senior Member of Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('Suresh', 'Martin', '26-JUL', '415 555 1918', 'SUMARTIN', '25517', 'OP200-8-857', 'Senior Member of Technical Staff', 'Decision Support Systems');
insert into flrpeople values ('David', 'Blake', '02-SEP', '415 555 2236', 'DABLAKE', '2207', 'OP200-8-862', 'Director, Open Interfaces', 'Open Interfaces & OTM');
insert into flrpeople values ('Kin', 'Clark', '23-AUG', '415 555 3143', 'KICLARK', '6768', 'OP200-8-871', 'Senior Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Pei-Chiang', 'Scott', '26-MAR', '415 555 9342', 'PESCOTT', '10400', 'OP200-8-869', 'Sr. Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Swaranjit', 'King', '04-DEC', '415-555-3729', 'SWKING', '17770', 'OP200-8-875', 'Senior Member of Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Leon', 'Turner', '07-AUG', '415 555 3238', 'LETURNER', '16760', 'OP200-8-861', 'Senior Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Samuel', 'Adams', '01-FEB', '415 555-2233', 'SAADAMS', '28078', 'OP200-8-860', 'Senior Member of Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Christopher', 'James', '30-AUG', '415 555 6058', 'CHJAMES', '29359', 'OP200-8-864', 'Senior Member of Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Andrew', 'Ford', '01-FEB', '415 555 5200', 'ANFORD', '21365', 'OP200-8-865', 'Technical Staff', 'Open Interfaces & OTM');
insert into flrpeople values ('Shrenik', 'Miller', '03-JUN', '415 555 7002', 'SHMILLER', '28505', 'OP200-8-872', 'Product Manager', 'Developer Documentation');
insert into flrpeople values ('Lori', 'Smith', '23-MAY', '415 555 3660', 'LOSMITH', '13100', 'OP200-8-832', 'Project Lead, D2K Common Documentation', 'Developer Documentation');
insert into flrpeople values ('Mary', 'Allen', '03-JUN', '415 555 6113', 'MAALLEN', '14100', 'OP200-8-868A', 'Senior Technical Writer', 'Developer Documentation');
insert into flrpeople values ('Harry', 'Ward', '01-FEB', '415 555 2728', 'HAWARD', '14598', 'OP200-8-816B', 'Product Manager', 'Developer Documentation');
insert into flrpeople values ('Dean', 'Jones', '01-FEB', '415 555 2489', 'DEJONES', '15769', 'OP200-8-828A', 'Product Manager', 'Developer Documentation');
insert into flrpeople values ('Frank', 'Martin', '27-SEP', '415 555 9216', 'FRMARTIN', '9562', 'OP200-8-880', 'Manager, Reports Documentation', 'Developer Documentation');
insert into flrpeople values ('Ingrid', 'Blake', '13-JAN', '415 555 5655', 'INBLAKE', '10542', 'OP200-8-868B', 'Senior Technical Writer', 'Developer Documentation');
insert into flrpeople values ('Barry', 'Clark', '01-FEB', '415 555 7695', 'BACLARK', '20514', 'OP200-8-892', 'Senior Product Manager', 'Developer Documentation');
insert into flrpeople values ('Marcie', 'Scott', '29-JUL', '415 555 1875', 'MASCOTT', '20577', 'OP200-8-882', 'Project Lead', 'Developer Documentation');
insert into flrpeople values ('Shaun', 'King', '01-FEB', '415-555-0116', 'SHKING', '15389', 'OP200-8-894', 'Principal Member of Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Yanrong', 'Turner', '01-FEB', '415 555 7626', 'YATURNER', '23591', 'OP200-8-887', 'Associate Quality Assurance Engineer', 'Oracle Reports');
insert into flrpeople values ('Simon', 'Adams', '12-APR', '415 555 7226', 'SIADAMS', '16019', 'OP200-8-804', 'Project Leader', 'Oracle Reports');
insert into flrpeople values ('Ashok', 'James', '23-MAR', '415 555 3632', 'ASJAMES', '11286', 'OP200-8-814', 'Development Manager, Reports Runtime', 'Oracle Reports');
insert into flrpeople values ('Yuri', 'Ford', '01-FEB', '415 555 8993', 'YUFORD', '17357', 'OP200-8-802', 'Project Leader', 'Oracle Reports');
insert into flrpeople values ('Boris', 'Miller', '23-FEB', '415 555 7704', 'BOMILLER', '13446', 'OP200-8-808', 'Senior Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Jennifer', 'Smith', '31-DEC', '415 633 2897', 'JESMITH', '14406', 'OP200-8-881', 'Member of Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Padmanabhan', 'Allen', '30-APR', '415 555 3792', 'PAALLEN', '19460', 'OP200-8-810', 'Project Lead, Quality Assurance', 'Oracle Reports');
insert into flrpeople values ('Chandana', 'Ward', '04-OCT', '415 555 9723', 'CHWARD', '13567', 'OP200-8-891', 'Quality Assurance Engineer', 'Oracle Reports');
insert into flrpeople values ('Stewart', 'Jones', '23-DEC', '415 555 7566', 'STJONES', '13518', 'OP200-8-886', 'Architect, Developer/2000', 'Oracle Reports');
insert into flrpeople values ('Robin', 'Martin', '06-SEP', '415 555 4489', 'ROMARTIN', '15707', 'OP200-8-890', 'Project Lead', 'Oracle Reports');
insert into flrpeople values ('George', 'Blake', '19-SEP', '415 555 0564', 'GEBLAKE', '16490', 'OP200-8-816A', 'Sr. Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Ken', 'Clark', '22-FEB', '415 555-8510', 'KECLARK', '12832', 'OP200-8-811', 'Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Yueh-hong', 'Scott', '23-JUL', '415 555 8662', 'YUSCOTT', '10353', 'OP200-8-812', 'Senior Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Steven', 'King', '01-FEB', '415 555 2226', 'STKING', '4235', 'OP200-8-806', 'Senior Development Manager, Reports', 'Oracle Reports');
insert into flrpeople values ('Tjiu', 'Turner', '01-FEB', '415 555-2694', 'TJTURNER', '17990', 'OP200-8-805', 'Senior Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Jenny', 'Adams', '01-FEB', '415 555-9955', 'JEADAMS', '23175', 'OP200-8-897', 'Senior Member of Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Danny', 'James', '05-AUG', '415 555 4762', 'DAJAMES', '22479', 'OP200-8-874', 'Manager of Product Engineering', 'Oracle Reports');
insert into flrpeople values ('Xin', 'Ford', '09-JUL', '415 555 5783', 'XIFORD', '28737', 'OP200-8-895', 'Member of Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Amer', 'Miller', '01-FEB', '415 555 8815', 'AMMILLER', '21594', 'OP200-8-809', 'Member of Technical Staff', 'Oracle Reports');
insert into flrpeople values ('Veena', 'Smith', '01-FEB', '415 555 9339', 'VESMITH', '20414', 'OP200-8-843', 'Member of Technical Staff', 'Toolkit Development');
insert into flrpeople values ('Teresa', 'Allen', '06-DEC', '415 555 2083', 'TEALLEN', '28519', 'OP200-8-827', 'Associate Quality Assurance Engineer', 'Oracle Graphics');
insert into flrpeople values ('Daniel', 'Ward', '01-FEB', '415 555-9750', 'DAWARD', '15893', 'OP200-8-820', 'Senior Technical Staff', 'Oracle Graphics');
insert into flrpeople values ('Dwight', 'Jones', '27-FEB', '415 555 4773', 'DWJONES', '12288', 'OP200-8-830', 'Sr. QA Engineer', 'Oracle Graphics');
insert into flrpeople values ('James', 'Martin', '15-FEB', '415 555 9916', 'JAMARTIN', '19279', 'OP200-8-824', 'Development Manager, Graphics', 'Oracle Graphics');
insert into flrpeople values ('Michael', 'Blake', '02-JUN', '415 555 8896', 'MIBLAKE', '12687', 'OP200-8-829', 'Technical Staff', 'Oracle Graphics');
insert into flrpeople values ('Alex', 'Clark', '01-FEB', '415 555-7803', 'ALCLARK', '23292', 'OP200-8-822', 'Senior Member Technical Staff', 'Oracle Graphics');
insert into flrpeople values ('Jean', 'Scott', '01-DEC', '415 555-7653', 'JESCOTT', '23297', 'OP200-8-828B', 'Member of Technical Staff', 'Oracle Graphics');
insert into flrpeople values ('Marta', 'King', '01-FEB', '415 555 3780', 'MAKING', '23465', 'OP200-8-823', 'Technical Staff', 'Oracle Graphics');

drop table usa;

create table usa (state varchar2(2),data number(9));

insert into usa values ('CA', 23668562);
insert into usa values ('HI', 965000);
insert into usa values ('AK', 400481);
insert into usa values ('WA', 4130163);
insert into usa values ('OR', 2632663);
insert into usa values ('ID', 943935 );
insert into usa values ('NV', 799184);
insert into usa values ('UT', 1461037);
insert into usa values ('AZ', 2717860);
insert into usa values ('CO', 2888834);
insert into usa values ('ND', 652695);
insert into usa values ('SD', 690178);
insert into usa values ('MT', 786690);
insert into usa values ('MN', 4077148);
insert into usa values ('NE', 1570006);
insert into usa values ('TX', 14228383);
insert into usa values ('OK', 3025266);
insert into usa values ('MI', 9258344);
insert into usa values ('OH', 10797419);
insert into usa values ('IL', 11418461);
insert into usa values ('IN', 5490179);
insert into usa values ('IA', 2913387);
insert into usa values ('KS', 2363208);
insert into usa values ('MO', 4917444);
insert into usa values ('KY', 3661433);
insert into usa values ('TN', 4590750);
insert into usa values ('AR', 2285513);
insert into usa values ('AL', 3890061);
insert into usa values ('MS', 2520638);
insert into usa values ('FL', 9739992);
insert into usa values ('PA', 11866728);
insert into usa values ('NY', 17557288);
insert into usa values ('NC', 5874429);
insert into usa values ('SC', 3119208);
insert into usa values ('GA', 5464265);
insert into usa values ('VA', 5346279);
insert into usa values ('WV', 1949644);
insert into usa values ('MD', 4216446);
insert into usa values ('DE', 595225);
insert into usa values ('MA', 5737037);
insert into usa values ('RI', 9471154);
insert into usa values ('NH', 920610);
insert into usa values ('VT', 511456);
insert into usa values ('ME', 1124660);
insert into usa values ('WY', 59616);
insert into usa values ('NM', 1299968);
insert into usa values ('LA', 4203972);
insert into usa values ('NJ', 7364158);
insert into usa values ('CT', 3107576);
insert into usa values ('WI', 4705335);

drop table cities;

create table cities (
			state varchar2(2),
			city  varchar2(25),
			population number(8),
			white number(6,2),
			black number(6,2),
			hispanic number(6,2),
			asian number(6,2),
			other number(6,2)
);

insert into cities values(
			'NY',
			'New York',
			7311966,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Santa Barbara',
			89000,
			0,0,0,0,0
			);

insert into cities values(
			'CO',
			'Boulder',
			76000,
			0,0,0,0,0
			);

insert into cities values(
			'NM',
			'Santa Fe',
			49000,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Los Angeles',
			3489779,
			0,0,0,0,0
			);

insert into cities values(
			'IL',
			'Chicago',
			2768483,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Houston',
			1690180,
			0,0,0,0,0
			);

insert into cities values(
			'PA',
			'Philadelphia',
			1552572,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'San Diego',
			1148851,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Dallas',
			1022497,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Phoenix',
			1012230,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Detroit',
			1012110,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'San Antonio',
			966437,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'San Jose',
			801331,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'CDE Graphics Developers',
			5,
			0,0,0,0,0
			);

insert into cities values(
			'IN',
			'Indianapolis',
			746538,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'San Francisco',
			728921,
			0,0,0,0,0
			);

insert into cities values(
			'MD',
			'Baltimore',
			726096,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Jacksonville ',
			661177,
			0,0,0,0,0
			);

insert into cities values(
			'OH',
			'Columbus',
			642987,
			0,0,0,0,0
			);

insert into cities values(
			'WI',
			'Milwaukee',
			617043,
			0,0,0,0,0
			);

insert into cities values(
			'TN',
			'Memphis',
			610275,
			0,0,0,0,0
			);

insert into cities values(
			'DC',
			'Washington',
			585221,
			0,0,0,0,0
			);

insert into cities values(
			'MA',
			'Boston',
			551675,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'El Paso',
			543813,
			0,0,0,0,0
			);

insert into cities values(
			'WA',
			'Seattle',
			519598,
			0,0,0,0,0
			);

insert into cities values(
			'OH',
			'Cleveland',
			502539,
			0,0,0,0,0
			);

insert into cities values(
			'TN',
			'Nashville-Davidson',
			495012,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Austin',
			492329,
			0,0,0,0,0
			);

insert into cities values(
			'LA',
			'New Orleans',
			489595,
			0,0,0,0,0
			);

insert into cities values(
			'CO',
			'Denver',
			483852,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Fort Worth',
			454430,
			0,0,0,0,0
			);

insert into cities values(
			'OK',
			'Oklahoma City',
			453995,
			0,0,0,0,0
			);

insert into cities values(
			'OR',
			'Portland',
			445458,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Long Beach',
			438771,
			0,0,0,0,0
			);

insert into cities values(
			'MO',
			'Kansas City',
			431553,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Virginia Beach',
			417061,
			0,0,0,0,0
			);

insert into cities values(
			'NC',
			'Charlotte',
			416294,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Tucson',
			415079,
			0,0,0,0,0
			);

insert into cities values(
			'NM',
			'Albuquerque',
			398492,
			0,0,0,0,0
			);

insert into cities values(
			'GA',
			'Atlanta',
			394848,
			0,0,0,0,0
			);

insert into cities values(
			'MO',
			'St. Louis',
			383733,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Sacramento',
			382816,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Fresno',
			376130,
			0,0,0,0,0
			);

insert into cities values(
			'OK',
			'Tulsa',
			375307,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Oakland',
			373219,
			0,0,0,0,0
			);

insert into cities values(
			'HI',
			'Honolulu CDP',
			371320,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Miami',
			367016,
			0,0,0,0,0
			);

insert into cities values(
			'PA',
			'Pittsburgh',
			366852,
			0,0,0,0,0
			);

insert into cities values(
			'OH',
			'Cincinnati',
			364278,
			0,0,0,0,0
			);

insert into cities values(
			'MN',
			'Minneapolis',
			362696,
			0,0,0,0,0
			);

insert into cities values(
			'NE',
			'Omaha',
			339671,
			0,0,0,0,0
			);

insert into cities values(
			'OH',
			'Toledo',
			329325,
			0,0,0,0,0
			);

insert into cities values(
			'NY',
			'Buffalo',
			323284,
			0,0,0,0,0
			);

insert into cities values(
			'KS',
			'Wichita',
			311746,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Mesa',
			296645,
			0,0,0,0,0
			);

insert into cities values(
			'CO',
			'Colorado Springs',
			295815,
			0,0,0,0,0
			);

insert into cities values(
			'NV',
			'Las Vegas',
			295516,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Santa Ana',
			288024,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Tampa',
			284737,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Arlington',
			275907,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Anaheim',
			274162,
			0,0,0,0,0
			);

insert into cities values(
			'KY',
			'Louisville',
			271038,
			0,0,0,0,0
			);

insert into cities values(
			'MN',
			'St. Paul',
			268266,
			0,0,0,0,0
			);

insert into cities values(
			'NJ',
			'Newark',
			267849,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Corpus Christi',
			266412,
			0,0,0,0,0
			);

insert into cities values(
			'AL',
			'Birmingham',
			264984,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Norfolk',
			253768,
			0,0,0,0,0
			);

insert into cities values(
			'AK',
			'Anchorage',
			245866,
			0,0,0,0,0
			);

insert into cities values(
			'CO',
			'Aurora',
			239626,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Riverside',
			238601,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'St. Petersburg',
			235306,
			0,0,0,0,0
			);

insert into cities values(
			'NY',
			'Rochester',
			234163,
			0,0,0,0,0
			);

insert into cities values(
			'KY',
			'Lexington-Fayette',
			232562,
			0,0,0,0,0
			);

insert into cities values(
			'NJ',
			'Jersey City',
			228575,
			0,0,0,0,0
			);

insert into cities values(
			'LA',
			'Baton Rouge',
			224704,
			0,0,0,0,0
			);

insert into cities values(
			'OH',
			'Akron',
			223621,
			0,0,0,0,0
			);

insert into cities values(
			'NC',
			'Raleigh',
			220524,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Stockton',
			219621,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Richmond',
			202263,
			0,0,0,0,0
			);

insert into cities values(
			'AL',
			'Mobile',
			201896,
			0,0,0,0,0
			);

insert into cities values(
			'NE',
			'Lincoln',
			197488,
			0,0,0,0,0
			);

insert into cities values(
			'LA',
			'Shreveport',
			196645,
			0,0,0,0,0
			);

insert into cities values(
			'MS',
			'Jackson',
			196231,
			0,0,0,0,0
			);

insert into cities values(
			'WI',
			'Madison',
			195161,
			0,0,0,0,0
			);

insert into cities values(
			'IA',
			'Des Moines',
			194540,
			0,0,0,0,0
			);

insert into cities values(
			'AL',
			'Montgomery',
			192125,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Hialeah',
			191702,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Grand Rapids',
			191230,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Garland',
			191186,
			0,0,0,0,0
			);

insert into cities values(
			'NC',
			'Greensboro',
			189924,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Bakersfield',
			187985,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Lubbock',
			187941,
			0,0,0,0,0
			);

insert into cities values(
			'WA',
			'Spokane',
			187429,
			0,0,0,0,0
			);

insert into cities values(
			'NY',
			'Yonkers',
			186063,
			0,0,0,0,0
			);

insert into cities values(
			'GA',
			'Columbus',
			185744,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Huntington Beach',
			185055,
			0,0,0,0,0
			);

insert into cities values(
			'WA',
			'Tacoma',
			183890,
			0,0,0,0,0
			);

insert into cities values(
			'OH',
			'Dayton',
			183189,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Fremont',
			179300,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Glendale',
			177671,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Newport News',
			177286,
			0,0,0,0,0
			);

insert into cities values(
			'AR',
			'Little Rock',
			176870,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Orlando',
			174215,
			0,0,0,0,0
			);

insert into cities values(
			'IN',
			'Fort Wayne',
			173717,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'San Bernardino',
			172451,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Modesto',
			172292,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Arlington CDP',
			171582,
			0,0,0,0,0
			);

insert into cities values(
			'TN',
			'Knoxville',
			167287,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Chesapeake',
			166005,
			0,0,0,0,0
			);

insert into cities values(
			'UT',
			'Salt Lake City',
			165835,
			0,0,0,0,0
			);

insert into cities values(
			'MA',
			'Worcester',
			163414,
			0,0,0,0,0
			);

insert into cities values(
			'AL',
			'Huntsville',
			163319,
			0,0,0,0,0
			);

insert into cities values(
			'NY',
			'Syracuse',
			162835,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Irving',
			161261,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Amarillo',
			161065,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Glendale',
			156165,
			0,0,0,0,0
			);

insert into cities values(
			'RI',
			'Providence',
			155418,
			0,0,0,0,0
			);

insert into cities values(
			'MA',
			'Springfield',
			153466,
			0,0,0,0,0
			);

insert into cities values(
			'TN',
			'Chattanooga',
			152888,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Fort Lauderdale',
			148524,
			0,0,0,0,0
			);

insert into cities values(
			'KS',
			'Kansas City',
			146507,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Garden Grove',
			145874,
			0,0,0,0,0
			);

insert into cities values(
			'MO',
			'Springfield',
			145438,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Oxnard',
			144805,
			0,0,0,0,0
			);

insert into cities values(
			'NC',
			'Winston-Salem',
			144791,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Chula Vista',
			144752,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Warren',
			142404,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Tempe',
			142139,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Plano',
			142106,
			0,0,0,0,0
			);

insert into cities values(
			'IL',
			'Rockford',
			141679,
			0,0,0,0,0
			);

insert into cities values(
			'NC',
			'Durham',
			140926,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Pomona',
			140364,
			0,0,0,0,0
			);

insert into cities values(
			'NV',
			'Reno',
			139884,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Oceanside',
			139718,
			0,0,0,0,0
			);

insert into cities values(
			'NJ',
			'Paterson',
			139358,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Flint',
			139311,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Ontario',
			138981,
			0,0,0,0,0
			);

insert into cities values(
			'GA',
			'Savannah',
			138908,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Hampton',
			137048,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Scottsdale',
			137022,
			0,0,0,0,0
			);

insert into cities values(
			'CT',
			'Bridgeport',
			137020,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Laredo',
			136508,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Torrance',
			135642,
			0,0,0,0,0
			);

insert into cities values(
			'ID',
			'Boise City',
			135506,
			0,0,0,0,0
			);

insert into cities values(
			'ID',
			'Moscow',
			20000,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Pasadena',
			132605,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Moreno Valley',
			132105,
			0,0,0,0,0
			);

insert into cities values(
			'CT',
			'Hartford',
			131995,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Tallahassee',
			130357,
			0,0,0,0,0
			);

insert into cities values(
			'IN',
			'Evansville',
			127566,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Lansing',
			126722,
			0,0,0,0,0
			);

insert into cities values(
			'CO',
			'Lakewood',
			125957,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Pasadena',
			125418,
			0,0,0,0,0
			);

insert into cities values(
			'CT',
			'New Haven',
			123966,
			0,0,0,0,0
			);

insert into cities values(
			'FL',
			'Hollywood',
			121732,
			0,0,0,0,0
			);

insert into cities values(
			'KS',
			'Topeka',
			120257,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Irvine',
			119389,
			0,0,0,0,0
			);

insert into cities values(
			'KS',
			'Overland Park',
			119260,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Santa Clarita',
			118676,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Sunnyvale',
			118438,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Sterling Heights',
			118314,
			0,0,0,0,0
			);

insert into cities values(
			'IN',
			'Gary',
			116702,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Santa Rosa',
			116554,
			0,0,0,0,0
			);

insert into cities values(
			'OR',
			'Eugene',
			115963,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Beaumont',
			115494,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Fullerton',
			115476,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Hayward',
			115189,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Salinas',
			114762,
			0,0,0,0,0
			);

insert into cities values(
			'IL',
			'Peoria',
			113983,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Vallejo',
			113703,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Orange',
			113591,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Escondido',
			113161,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Alexandria',
			113134,
			0,0,0,0,0
			);

insert into cities values(
			'MO',
			'Independence',
			112713,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Concord',
			112688,
			0,0,0,0,0
			);

insert into cities values(
			'OR',
			'Salem',
			112050,
			0,0,0,0,0
			);

insert into cities values(
			'IA',
			'Cedar Rapids',
			111659,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Inglewood',
			111496,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Rancho Cucamonga',
			111161,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Ann Arbor',
			109766,
			0,0,0,0,0
			);

insert into cities values(
			'PA',
			'Erie',
			109267,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Mesquite',
			108324,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Abilene',
			108095,
			0,0,0,0,0
			);

insert into cities values(
			'NJ',
			'Elizabeth',
			107915,
			0,0,0,0,0
			);

insert into cities values(
			'CT',
			'Stamford',
			107590,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Thousand Oaks',
			107522,
			0,0,0,0,0
			);

insert into cities values(
			'GA',
			'Macon',
			107257,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'El Monte',
			106935,
			0,0,0,0,0
			);

insert into cities values(
			'CT',
			'Waterbury',
			106904,
			0,0,0,0,0
			);

insert into cities values(
			'IL',
			'Springfield',
			106429,
			0,0,0,0,0
			);

insert into cities values(
			'PA',
			'Allentown',
			106429,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Lancaster',
			106139,
			0,0,0,0,0
			);

insert into cities values(
			'IN',
			'South Bend',
			105942,
			0,0,0,0,0
			);

insert into cities values(
			'IL',
			'Aurora',
			105929,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Brownsville',
			105757,
			0,0,0,0,0
			);

insert into cities values(
			'SD',
			'Sioux Falls',
			105634,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Grand Prairie',
			104482,
			0,0,0,0,0
			);

insert into cities values(
			'VA',
			'Portsmouth',
			104361,
			0,0,0,0,0
			);

insert into cities values(
			'TX',
			'Waco',
			103997,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Simi Valley',
			103813,
			0,0,0,0,0
			);

insert into cities values(
			'MI',
			'Livonia',
			101375,
			0,0,0,0,0
			);

insert into cities values(
			'CA',
			'Berkeley',
			101122,
			0,0,0,0,0
			);

insert into cities values(
			'WI',
			'Green Bay',
			100459,
			0,0,0,0,0
			);

insert into cities values(
			'AZ',
			'Chandler',
			100173,
			0,0,0,0,0
			);

drop table sales_revenue;

create table sales_revenue (
	sname varchar2(25),
	quarter varchar2(2),
	revenue number(6)
);

insert into sales_revenue values ('ALLEN', 'Q1', 10000);
insert into sales_revenue values ('WARD', 'Q1', 9000);
insert into sales_revenue values ('MARTIN', 'Q1', 12000);
insert into sales_revenue values ('TURNER', 'Q1', 18000);
insert into sales_revenue values ('ALLEN', 'Q2', 7000);
insert into sales_revenue values ('WARD', 'Q2', 10000);
insert into sales_revenue values ('MARTIN', 'Q2', 15000);
insert into sales_revenue values ('TURNER', 'Q2', 8000);
insert into sales_revenue values ('ALLEN', 'Q3', 14000);
insert into sales_revenue values ('WARD', 'Q3', 9000);
insert into sales_revenue values ('MARTIN', 'Q3', 5000);
insert into sales_revenue values ('TURNER', 'Q3', 8000);
insert into sales_revenue values ('ALLEN', 'Q4', 20000);
insert into sales_revenue values ('WARD', 'Q4', 11000);
insert into sales_revenue values ('MARTIN', 'Q4', 19000);
insert into sales_revenue values ('TURNER', 'Q4', 13000);

commit;
REM *** End Oracle Graphics Requirements ***

REM *** Reports stuff ***

CREATE TABLE ACCTS (
		SSN             NUMBER,
		LASTNAME        VARCHAR2(30),
		FIRSTNAME       VARCHAR2(30),
		MI              VARCHAR2(1),
		SALUT           VARCHAR2(4),
		INV_ADVISER     VARCHAR2(40), 
		PCT_VESTED      NUMBER,
		PCT_DEFERRAL    NUMBER);
	
insert into accts values (545124200,'Williams','Clayton', 'K', 'Mr.','Joyce Chen',100,15);
insert into accts values (559014201,'Costner','Robert', 'M', 'Mr.', 'Bob Mercado',100,10);
insert into accts values (559014202,'Fisher','Julie', 'L', 'Ms.', 'Eric Kumar',1100,5);
insert into accts values (559014203,'Abers','Jeff', 'K', 'Mr.','Karen Simpson', 100,2);
insert into accts values (559014204,'Matsumoto','Charles', 'J', 'Mr.', 'Dennis Sciortino',100,15);


CREATE TABLE FUNDS(
		FUND_ID         NUMBER,
		FUND_SYMBOL     VARCHAR2(4),
		NAME            VARCHAR2(40),
		TYPE            VARCHAR2(20));

insert into funds values(1,'JGIC','Johnson GIC', 'GIC');
insert into funds values(2,'ANCI','Ancia Industrial', 'GIC');
insert into funds values(3,'BGIC','Boston GIC', 'Growth');
insert into funds values(4,'DLTX','Delta Index', 'GIC');
insert into funds values(5,'ANDT','Anderson Trust', 'Conservative');

CREATE TABLE INVINFO(
		FUND_ID NUMBER, 
		INV     VARCHAR2(40),
		INFO    VARCHAR2(500));

insert into invinfo values (6,'Variable Annuities','A variable annuity bundles a collection of mutual funds into a tax-deferred wrapper that functions in a manner similar to an individual retirement account. Investors can switch money between the funds without triggering taxes, and earnings grow tax-deferred until taken out.'); 
insert into invinfo values (1,'Johnson GIC', 'Johnson GIC is a growth and income fund.  It seeks a high total return through a combination of current income and capital appreciation.  It invests in securities of companies that pay current dividends and offer potential growth of earnings, such as common stocks, securities convertible into common stocks, preferred stocks and fixed-income securities.  Dividend amounts will vary. ');
insert into invinfo values (3,'Boston GIC', 'Boston GIC is a growth and income fund.  It seeks a high total return through a combination of current income and capital appreciation.  It invests in securities of companies that pay current dividends and offer potential growth of earnings, such as common stocks, securities convertible into common stocks, preferred stocks and fixed-income securities.  Dividend amounts will vary. ');
insert into invinfo values (4,'Delta Index', 'Delta Index is a growth and income fund. It seeks investment results that correspond to the total return performance of the S+P 500, which is comprised of common stocks.  Dividend amounts will vary.  The portfolios share price and return will fluctuate.');
insert into invinfo values (2,'Delta Intermediate Bond Fund' , 'Delta Intermediate Bond Fund is an income fund.  It seeks a high current income by investing primarily in investment-grade fixed-income obligations rated Baa or better, including corporate bonds, mortgage securities, bank obligations and US government and agency securities.  The Funds dollar weighted average maturity ranges between three and ten years.  The funds share price, yield and return will fluctuate.');

CREATE TABLE INVREQUEST(
			SSN NUMBER,
			FUND_ID NUMBER);

insert into invrequest values (545124200,1);
insert into invrequest values (545124200,3);
insert into invrequest values (545124200,4);
insert into invrequest values (559014201,1);
insert into invrequest values (559014201,2);
insert into invrequest values (559014202,3);
insert into invrequest values (559014202,6);
insert into invrequest values (559014203,4);
insert into invrequest values (559014203,2);
insert into invrequest values (559014203,1);
insert into invrequest values (559014204,6);
insert into invrequest values (559014204,3);
		

CREATE TABLE ACCT_ADDRS (
		SSN             NUMBER,
		STREET          VARCHAR2(30),
		CITY            VARCHAR2(25),
		STATE           VARCHAR2(20),
		ZIP             VARCHAR2(12));

insert into acct_addrs values (545124200,'5250 Shoreline Way','Pacifica', 'CA','94915');
insert into acct_addrs values (559014201,'8188 Westbrook Avenue','Brisbane', 'CA','95051');
insert into acct_addrs values (559014202,'2391 Aspen Street','Atlanta', 'GA', '30054');
insert into acct_addrs values (559014203,'22 Kings Lane','Hillside','CT','02381');
insert into acct_addrs values (559014204,'9655 Hilo Street','Monterey','CA', '94502');



CREATE TABLE F_EMPCOMP (
		EMPCOMP         NUMBER, 
		EMCONAME        VARCHAR2(30));

insert into f_empcomp values(1,'Employee Contributions');
insert into f_empcomp values(2,'Company Matching Account');


CREATE TABLE FUND_XACT (
		EMPCOMP         NUMBER, 
		XACT_ID         NUMBER,
		SSN             NUMBER,
		FUND_ID         NUMBER,
		TRANS_TYPE      VARCHAR2(20),
		AMOUNT          NUMBER);

insert into fund_xact values (1,00, 545124200, 2, 'bb', 1905.63);
insert into fund_xact values (1,01, 545124200, 2, 'in', 999.98);
insert into fund_xact values (1,02, 545124200, 2, 'cn', 1203.88);
insert into fund_xact values (1,03, 545124200, 2, 'li', 22.50);
insert into fund_xact values (1,04, 545124200, 2, 'di', 22.50);

insert into fund_xact values (2,05, 545124200, 5, 'bb', 455.24);
insert into fund_xact values (2,06, 545124200, 5, 'cn', 101.52);

insert into fund_xact values (1,100, 559014201, 2, 'in', 205.74);
insert into fund_xact values (1,101, 559014201, 4, 'in', 200.74);
insert into fund_xact values (1,102, 559014201, 2, 'cn', 122.24);
insert into fund_xact values (1,103, 559014201, 4, 'cn', 124.48);
insert into fund_xact values (1,11003, 559014201, 2, 'di', 22.25);

insert into fund_xact values (2,180, 559014201, 2, 'in', 915.74);
insert into fund_xact values (2,181, 559014201, 4, 'in', 910.74);
insert into fund_xact values (2,182, 559014201, 2, 'cn', 912.24);
insert into fund_xact values (2,183, 559014201, 4, 'cn', 914.48);

insert into fund_xact values (1,200, 559014202, 1, 'bb', 100.74);
insert into fund_xact values (1,201, 559014202, 1, 'in', 10.40);
insert into fund_xact values (1,202, 559014202, 2, 'bb', 211.11);
insert into fund_xact values (1,203, 559014202, 2, 'cn', 1200.74); 
insert into fund_xact values (1,204, 559014202, 3, 'bb', 100.74); 
insert into fund_xact values (1,205, 559014202, 3, 'cn', 1103.50); 

insert into fund_xact values (1,301, 559014203, 2, 'in', 210.55);
insert into fund_xact values (1,302, 559014203, 3, 'in', 212.55);
insert into fund_xact values (1,303, 559014203, 4, 'in', 110.55);
insert into fund_xact values (1,304, 559014203, 5, 'in', 210.74);

insert into fund_xact values (1,3015, 559014203, 2, 'cn', 1215.74);
insert into fund_xact values (1,3016, 559014203, 3, 'cn', 1216.91);
insert into fund_xact values (1,3017, 559014203, 4, 'cn', 1217.28);
insert into fund_xact values (1,3018, 559014203, 5, 'cn', 1218.00);
insert into fund_xact values (1,3000, 559014203, 3, 'xf', -333.33);

insert into fund_xact values (2,3002, 559014203, 2, 'cn', 3212.74);
insert into fund_xact values (2,3003, 559014203, 1, 'cn', 3213.40);
insert into fund_xact values (2,3004, 559014203, 3, 'cn', 3214.74);

insert into fund_xact values (1,4019, 559014204, 3, 'cn', 1200.74);
insert into fund_xact values (1,4001, 559014204, 3, 'di', -200.74);
insert into fund_xact values (1,4020, 559014204, 5, 'cn', 1200.74);
insert into fund_xact values (1,4021, 559014204, 5, 'in', 333.33);

insert into fund_xact values (1,5022, 559014205, 1, 'in', 333.33);
insert into fund_xact values (1,5023, 559014205, 2, 'in', 333.33);
insert into fund_xact values (1,5024, 559014205, 3, 'in', 333.33);
insert into fund_xact values (1,5025, 559014205, 1, 'bb', 331.33);
insert into fund_xact values (1,5026, 559014205, 2, 'bb', 332.33);
insert into fund_xact values (1,5027, 559014205, 3, 'bb', 333.33);

insert into fund_xact values (1,5028, 559014205, 1, 'xf', -300.33);

CREATE TABLE F_XACT_TYPE(
		TYPE            VARCHAR2(2),
		DESCRIPTION     VARCHAR2(20)); 

insert into f_xact_type values ('bb','Beginning Balance');
insert into f_xact_type values ('xf','Transfers');
insert into f_xact_type values ('cn','Contributions');
insert into f_xact_type values ('in','Fund Income');
insert into f_xact_type values ('lp','Loan Principal');
insert into f_xact_type values ('li','Loan Interest');
insert into f_xact_type values ('di','Dists./Withdrawals');



CREATE TABLE FUND_CONTRIB(
		SSN             NUMBER,
		FUND_ID         NUMBER,
		PCT_DIST        NUMBER);
		
insert into fund_contrib values (545124200, 2, 90);
insert into fund_contrib values (545124200, 5, 10);

insert into fund_contrib values (559014201, 2, 80);
insert into fund_contrib values (559014201, 4, 20);

insert into fund_contrib values (559014202, 1, 55);
insert into fund_contrib values (559014202, 3, 45);

insert into fund_contrib values (559014203, 1, 20);
insert into fund_contrib values (559014203, 2, 20);
insert into fund_contrib values (559014203, 3, 20);
insert into fund_contrib values (559014203, 4, 20);
insert into fund_contrib values (559014203, 5, 20);
			
insert into fund_contrib values (559014204, 3, 50);
insert into fund_contrib values (559014204, 5, 50);

insert into fund_contrib values (559014205, 1, 25);
insert into fund_contrib values (559014205, 2, 50);
insert into fund_contrib values (559014205, 3, 25);

CREATE TABLE STOCK_HISTORY (    SYMBOL VARCHAR2(12) NOT NULL,
				SALES   NUMBER,
				HIGH_365  NUMBER,
				LOW_365  NUMBER,
				DIV  NUMBER,
				P_E  NUMBER,
				YIELD  NUMBER );

REM SYMBOL           SALES  HIGH_365   LOW_365       DIV       P_E     YIELD                            
REM ------------ --------- --------- --------- --------- --------- ---------                            

insert into stock_history values ('ORCL',64043, 53, 23, 1.2,  21,  7);                            
insert into stock_history values ('MSFT',23000, 57, 12,  .8,  16,  3);                           
insert into stock_history values ('CSCO',1200,  35,  8,  .23, 12,  4);
insert into stock_history values ('VLVO',4500,  20,  9,  .45, 40, 3);
insert into stock_history values ('ALCB',12311, 34,  8,   0,  1.2,NULL);
insert into stock_history values ('WBTK',12555, 35, 11, 1.2,  4,  NULL );
insert into stock_history values ('DYTY',66534, 34, 25, 20,   1.4, 10);
insert into stock_history values ('GUIG',10553, 45, 23,  .85, 4, NULL);
insert into stock_history values ('ULTM',3334,  18, 10,    0, 12,NULL);
insert into stock_history values ('OJSP',9533,  50, 15,   1.2, 4,NULL);
insert into stock_history values ('VICA',3432,  36,  2,   0,  30,NULL);


CREATE TABLE STOCKS ( 
	SYMBOL                          VARCHAR2(10) NOT NULL,
	COMPANY                         VARCHAR2(20) NOT NULL,
	CURRENT_PRICE                   NUMBER(7,3) NOT NULL,
	TRADE_DATE                      DATE,
	NUMBER_TRADED_TODAY             NUMBER,
	TODAYS_HIGH                     NUMBER,
	TODAYS_LOW                      NUMBER);



REM SYMBOL     COMPANY  CURRENT_PRICE TRADE_DAT NUMBER_TRADED_TODAY TODAYS_HIGH TODAYS_LOW  
REM ---------- -------- ------------- --------- ------------------- ----------- ----------  

insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.13, '01-SEP-97',   666,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      25.77, '01-SEP-97',   746,       25.77,      23.15);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.28, '01-SEP-97',  1500,        5.83,       5.39);
insert into stocks values ('GUIG', 'GUI Intl.',           25.32, '01-SEP-97',   203,        28.4,      24.61);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.35, '01-SEP-97',   290,        14.5,      14.38);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.42, '01-SEP-97',  1341,       11.45,      11.27);
insert into stocks values ('ORCL', 'Oracle Corp.',        49.00, '01-SEP-97',  1315,       49.77,      44.73);
insert into stocks values ('VICA', 'Victoria Apparel',    35.77, '01-SEP-97',   547,       36.23,      34.89);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '01-SEP-97',  1672,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               28.55, '01-SEP-97',   916,          29,      27.14);
insert into stocks values ('CSCO', 'Cisco Systems',       20.5,  '01-SEP-97',  1306,       22.28,      18.06);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.25, '31-AUG-97',  4277,       18.25,      18.25);
insert into stocks values ('WBTK', 'Webbe Transport',      22.5,  '31-AUG-97',  2893,        22.5,       22.5);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.45, '31-AUG-97',100000,        5.45,       5.45);
insert into stocks values ('GUIG', 'GUI Intl.',           28.4,  '31-AUG-97', 50218,        28.4,       28.4);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.5,  '31-AUG-97', 1240,        14.5,       14.5);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.25, '31-AUG-97', 2388,       11.25,      11.25);
insert into stocks values ('ORCL', 'Oracle Corp.',        47.25, '31-AUG-97', 95300,       47.25,      47.25);
insert into stocks values ('VICA', 'Victoria Apparel',    35,    '31-AUG-97', 4500,          35,         35);
insert into stocks values ('MSFT', 'Microsoft',           27,    '31-AUG-97', 2400,          27,         27);
insert into stocks values ('VLVO', 'Volvo',               29,    '31-AUG-97', 8400,          29,         29);
insert into stocks values ('CSCO', 'Cisco Systems',       17,    '31-AUG-97', 24250,          17,         17);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.31, '11-OCT-97',   528,       15.31,      14.51);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   14.86, '11-OCT-97',  12174,       12.92,      11.56);
insert into stocks values ('ORCL', 'Oracle Corp.',        104.77,'11-OCT-97',  4338,      106.91,      56.16);
insert into stocks values ('VICA', 'Victoria Apparel',    52.73, '11-OCT-97',  1486,       52.73,      38.19);
insert into stocks values ('MSFT', 'Microsoft',           34.02, '11-OCT-97',  56445,       37.22,      27.01);
insert into stocks values ('VLVO', 'Volvo',               38.68, '11-OCT-97',   858,       39.47,      29.24);
insert into stocks values ('CSCO', 'Cisco Systems',       44.01, '11-OCT-97',  3246,       44.96,      22.59);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  21.19, '11-OCT-97',   624,       21.19,      18.74);
insert into stocks values ('WBTK', 'Webbe Transport',      34.97, '11-OCT-97',  4255,       36.41,      25.28);
insert into stocks values ('DYTY', 'Dinosaur Toys',       9.71,  '11-OCT-97',  2732,        9.72,       6.07);
insert into stocks values ('GUIG', 'GUI Intl.',           54.23, '11-OCT-97',   416,       55.34,         30); 
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.27, '10-OCT-97',  1879,       15.31,      14.51);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.80, '10-OCT-97',  3496,       12.92,      11.56);
insert into stocks values ('ORCL', 'Oracle Corp.',        102.79,'10-OCT-97',  3519,      104.93,      55.76);
insert into stocks values ('VICA', 'Victoria Apparel',    51.18, '10-OCT-97',  1268,       51.72,      37.99);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '10-OCT-97',  5558,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               38.7,  '10-OCT-97',   810,       38.73,      29.09);
insert into stocks values ('CSCO', 'Cisco Systems',       44.94, '10-OCT-97',  2372,       44.96,      22.59);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  21.19, '10-OCT-97',   589,       21.19,      18.74);
insert into stocks values ('WBTK', 'Webbe Transport',      36.41, '10-OCT-97',  3225,       36.41,      25.28);
insert into stocks values ('DYTY', 'Dinosaur Toys',       8.97,  '10-OCT-97',  4666,        9.72,       6.07);
insert into stocks values ('GUIG', 'GUI Intl.',           53.22, '10-OCT-97',  285,       53.22,      29.57);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.77, '05-OCT-97',  561,       20.78,      18.66);
insert into stocks values ('WBTK', 'Webbe Transport',      35.05, '05-OCT-97',  3071,       35.05,      25.01);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.77, '06-OCT-97',  595,       20.78,      18.66);
insert into stocks values ('WBTK', 'Webbe Transport',      33.66, '06-OCT-97',  4052,       35.05,      25.01);
insert into stocks values ('DYTY', 'Dinosaur Toys',       8.98,  '06-OCT-97',  2602,        8.99,       5.93);
insert into stocks values ('GUIG', 'GUI Intl.',           49.33, '06-OCT-97',  394,       50.34,         29);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.19, '06-OCT-97',  502,       15.19,      14.49);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.68, '06-OCT-97',  2070,       12.74,      11.52);
insert into stocks values ('ORCL', 'Oracle Corp.',        95.27, '06-OCT-97',  4131,       97.21,      54.22);
insert into stocks values ('VICA', 'Victoria Apparel',    50.25, '06-OCT-97',  1415,       50.25,       37.7);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '06-OCT-97',  6136,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               37.24, '06-OCT-97',                       818,          38,      28.94);
insert into stocks values ('CSCO', 'Cisco Systems',       40.02, '06-OCT-97',                3092,       40.89,      21.78);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.77, '07-OCT-97',                      1156,       20.98,       18.7);
insert into stocks values ('WBTK', 'Webbe Transport',      35.02, '07-OCT-97',                      1993,       35.05,      25.01);
insert into stocks values ('DYTY', 'Dinosaur Toys',        8.98, '07-OCT-97',                      4294,        9.16,       5.96);
insert into stocks values ('GUIG', 'GUI Intl.',           48.3,  '07-OCT-97',               299,       50.34,         29);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.15, '07-OCT-97',                 691,       15.19,      14.49);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.74, '07-OCT-97',                3797,       12.74,      11.52);
insert into stocks values ('ORCL', 'Oracle Corp.',        97.09, '07-OCT-97',                2401,       97.21,      54.22);
insert into stocks values ('VICA', 'Victoria Apparel',    50.73, '07-OCT-97',                1318,       50.75,       37.8);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '07-OCT-97',                3810,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               37.23, '07-OCT-97',                1590,          38,      28.94);
insert into stocks values ('DYTY', 'Dinosaur Toys',        8.3,  '03-OCT-97',                6568,        8.49,       5.83);
insert into stocks values ('GUIG', 'GUI Intl.',           46.59, '03-OCT-97',                 241,       46.59,      28.25);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.62, '03-OCT-97',                6292,       12.62,       11.5);
insert into stocks values ('ORCL', 'Oracle Corp.',        86.47, '03-OCT-97',                2209,       90.07,      52.79);
insert into stocks values ('VICA', 'Victoria Apparel',    47.83, '03-OCT-97',                1631,       48.31,      37.31); 
insert into stocks values ('MSFT', 'Microsoft',           27.02, '03-OCT-97',                4779,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               37.28, '03-OCT-97',                2047,       37.28,       28.8);
insert into stocks values ('CSCO', 'Cisco Systems',       39.35, '03-OCT-97',                4346,       40.17,      21.63);
insert into stocks values ('DYTY', 'Dinosaur Toys',        8.99, '04-OCT-97',                3498,        8.99,       5.93);
insert into stocks values ('GUIG', 'GUI Intl.',           43.84, '04-OCT-97',                 368,       46.59,      28.25);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.19, '04-OCT-97',                2339,       15.19,      14.49);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.68, '04-OCT-97',                5735,       12.74,      11.52);
insert into stocks values ('ORCL', 'Oracle Corp.',        91.72, '04-OCT-97',                1977,       91.72,      53.12);
insert into stocks values ('VICA', 'Victoria Apparel',    49.28, '04-OCT-97',                 842,       49.28,       37.5);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '04-OCT-97',                5254,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               35.8,  '04-OCT-97',                2988,       37.28,       28.8);
insert into stocks values ('CSCO', 'Cisco Systems',       38.53, '04-OCT-97',                4643,       40.17,      21.63);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.36, '04-OCT-97',                2172,       20.78,      18.66);
insert into stocks values ('WBTK', 'Webbe Transport',      33.69, '04-OCT-97',                4862,       34.38,      24.88);
insert into stocks values ('DYTY', 'Dinosaur Toys',        8.29, '05-OCT-97',                4444,        8.99,       5.93);
insert into stocks values ('GUIG', 'GUI Intl.',           48.4,  '05-OCT-97',                 271,        48.4,      28.61);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.15, '05-OCT-97',                1788,       15.19,      14.49);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.62, '05-OCT-97',                3329,       12.74,      11.52);
insert into stocks values ('ORCL', 'Oracle Corp.',        93.47, '05-OCT-97',                3350,       95.42,      53.86);
insert into stocks values ('VICA', 'Victoria Apparel',    48.78, '05-OCT-97',                1206,       49.28,       37.5);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '05-OCT-97',                5292,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               37.25, '05-OCT-97',                 772,       37.28,       28.8);
insert into stocks values ('CSCO', 'Cisco Systems',       40.87, '05-OCT-97',                2258,       40.89,      21.78);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.38, '30-SEP-97',                 534,       20.38,      18.58);
insert into stocks values ('WBTK', 'Webbe Transport',      33.74, '30-SEP-97',                2925,       33.74,      24.75);
insert into stocks values ('DYTY', 'Dinosaur Toys',        7.69, '30-SEP-97',                4232,        8.34,        5.8);
insert into stocks values ('GUIG', 'GUI Intl.',           44.02, '30-SEP-97',                 257,       44.02,      27.73);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.78, '03-OCT-97',                1488,       20.78,      18.66);
insert into stocks values ('WBTK', 'Webbe Transport',      33.71, '03-OCT-97',                2963,       33.74,      24.75);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.03, '28-SEP-97',                1324,       15.03,      14.45);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.44, '28-SEP-97',                5994,       12.44,      11.46);
insert into stocks values ('ORCL', 'Oracle Corp.',        78.63, '28-SEP-97',                2103,       81.91,      51.16);
insert into stocks values ('VICA', 'Victoria Apparel',    45.54, '28-SEP-97',                1553,          46,      36.85);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '28-SEP-97',                4552,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               35.89, '28-SEP-97',                1950,       35.89,      28.52);
insert into stocks values ('CSCO', 'Cisco Systems',       35.78, '28-SEP-97',                4138,       36.53,      20.91);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  20.38, '28-SEP-97',                1417,       20.38,      18.58);
insert into stocks values ('WBTK', 'Webbe Transport',      32.44, '28-SEP-97',                2822,       32.48,       24.5);
insert into stocks values ('DYTY', 'Dinosaur Toys',        7.71, '28-SEP-97',                6256,        7.88,        5.7);
insert into stocks values ('GUIG', 'GUI Intl.',           42.38, '28-SEP-97',               229,       42.38,       27.4);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.07, '29-SEP-97',              2228,       15.07,      14.46);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.5,  '29-SEP-97',              5462,       12.56,      11.49);
insert into stocks values ('ORCL', 'Oracle Corp.',        83.41, '29-SEP-97',              1882,       83.41,      51.46);
insert into stocks values ('VICA', 'Victoria Apparel',    46.91, '29-SEP-97',               802,       46.92,      37.03);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '29-SEP-97',                5006,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               34.47, '29-SEP-97',                2847,       35.89,      28.52);
insert into stocks values ('CSCO', 'Cisco Systems',       35.04, '29-SEP-97',                4419,       36.53,      20.91);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.98, '29-SEP-97',                2069,       20.38,      18.58);
insert into stocks values ('WBTK', 'Webbe Transport',      32.43, '29-SEP-97',                4630,       33.09,      24.62);
insert into stocks values ('DYTY', 'Dinosaur Toys',        8.34, '29-SEP-97',               3332,        8.34,        5.8);
insert into stocks values ('GUIG', 'GUI Intl.',           39.87, '29-SEP-97',                 352,       42.38,       27.4);
insert into stocks values ('ULTM', 'Ultimate Lighting',   15.03, '30-SEP-97',                1704,       15.07,      14.46);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.44, '30-SEP-97',                3171,       12.56,      11.49);
insert into stocks values ('ORCL', 'Oracle Corp.',        85.01, '30-SEP-97',                3189,       86.78,      52.13);
insert into stocks values ('VICA', 'Victoria Apparel',    46.43, '30-SEP-97',                1149,       46.92,      37.03);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '30-SEP-97',                5040,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               35.86, '30-SEP-97',                 735,       35.89,      28.52);
insert into stocks values ('CSCO', 'Cisco Systems',       37.17, '30-SEP-97',                2151,       37.18,      21.04);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.95, '26-SEP-97',                 456,       14.95,      14.44);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.32, '26-SEP-97',                1878,       12.38,      11.45);
insert into stocks values ('ORCL', 'Oracle Corp.',        78.8,  '26-SEP-97',                3745,       80.41,      50.86);
insert into stocks values ('VICA', 'Victoria Apparel',    45.54, '26-SEP-97',                1282,       45.54,      36.76);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '26-SEP-97',                5566,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               34.51, '26-SEP-97',                 741,       35.21,      28.39);
insert into stocks values ('CSCO', 'Cisco Systems',       33.1,  '26-SEP-97',                2803,       33.82,      20.36);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.98, '26-SEP-97',                 539,       19.98,       18.5);
insert into stocks values ('WBTK', 'Webbe Transport',      31.19, '26-SEP-97',                3674,       32.48,       24.5);
insert into stocks values ('DYTY', 'Dinosaur Toys',        7.73, '26-SEP-97',                2360,        7.74,       5.68);
insert into stocks values ('GUIG', 'GUI Intl.',           40.82, '26-SEP-97',                 360,       41.65,      27.26);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.91, '27-SEP-97',                 626,       14.95,      14.44);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.38, '27-SEP-97',                3443,       12.38,      11.45);
insert into stocks values ('ORCL', 'Oracle Corp.',        80.3,  '27-SEP-97',                2177,       80.41,      50.86);
insert into stocks values ('VICA', 'Victoria Apparel',    46,    '27-SEP-97',                1194,          46,      36.85);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '27-SEP-97',                3456,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               34.5,  '27-SEP-97',                1442,       35.21,      28.39);
insert into stocks values ('CSCO', 'Cisco Systems',       35.11, '27-SEP-97',                2812,       35.83,      20.77);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.98, '27-SEP-97',                1049,       20.18,      18.54);
insert into stocks values ('WBTK', 'Webbe Transport',      32.45, '27-SEP-97',                1807,       32.48,       24.5);
insert into stocks values ('DYTY', 'Dinosaur Toys',        7.71, '27-SEP-97',                3894,        7.88,        5.7);
insert into stocks values ('GUIG', 'GUI Intl.',           39.96, '27-SEP-97',                 273,       41.65,      27.26);
insert into stocks values ('CSCO', 'Cisco Systems',       31.92, '22-SEP-97',                2678,       32.57,      20.11);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.58, '22-SEP-97',                 999,       19.78,      18.46);
insert into stocks values ('CSCO', 'Cisco Systems',       32.54, '23-SEP-97',                3942,       33.21,      20.24);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.98, '23-SEP-97',                1350,       19.98,       18.5);
insert into stocks values ('WBTK', 'Webbe Transport',      31.24, '23-SEP-97',                2688,       31.28,      24.26);
insert into stocks values ('DYTY', 'Dinosaur Toys',        7.15, '23-SEP-97',                5956,        7.31,       5.59);
insert into stocks values ('GUIG', 'GUI Intl.',           38.55, '23-SEP-97',                 219,       38.55,      26.64);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.91, '23-SEP-97',                1260,       14.91,      14.43);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.26, '23-SEP-97',                5706,       12.26,      11.43);
insert into stocks values ('ORCL', 'Oracle Corp.',        71.50, '23-SEP-97',                 2004,       74.48,      49.67);
insert into stocks values ('VICA', 'Victoria Apparel',    43.36, '23-SEP-97',                1479,       43.84,      36.42);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '23-SEP-97',                4337,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               34.55, '23-SEP-97',                1857,       34.55,      28.25);
insert into stocks values ('WBTK', 'Webbe Transport',      31.28, '20-SEP-97',                2652,       31.28,      24.26);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.62, '20-SEP-97',                3838,        7.17,       5.56);
insert into stocks values ('GUIG', 'GUI Intl.',           36.4,  '20-SEP-97',                 234,        36.4,      26.21);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.79, '20-SEP-97',                1542,       14.83,      14.41);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.08, '20-SEP-97',                2875,        12.2,      11.42);
insert into stocks values ('ORCL', 'Oracle Corp.',        70.29, '20-SEP-97',                2893,       71.76,      49.13);
insert into stocks values ('VICA', 'Victoria Apparel',    42.13, '20-SEP-97',                1041,       42.58,      36.16);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '20-SEP-97',                4571,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               33.24, '20-SEP-97',                 667,       33.27,         28);
insert into stocks values ('WBTK', 'Webbe Transport',      30.04, '21-SEP-97',                3499,       31.28,      24.26);
insert into stocks values ('DYTY', 'Dinosaur Toys',        7.17, '21-SEP-97',                2246,        7.17,       5.56);
insert into stocks values ('GUIG', 'GUI Intl.',           37.1,  '21-SEP-97',                 340,       37.86,       26.5);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.83, '21-SEP-97',                 433,       14.83,      14.41);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.14, '21-SEP-97',                1787,        12.2,      11.42);
insert into stocks values ('ORCL', 'Oracle Corp.',        71.65, '21-SEP-97',                3568,       73.11,       49.4);
insert into stocks values ('VICA', 'Victoria Apparel',    43.41, '21-SEP-97',                1221,       43.41,      36.33);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '21-SEP-97',                5299,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               33.22, '21-SEP-97',                 706,        33.9,      28.12);
insert into stocks values ('CSCO', 'Cisco Systems',       30.09, '21-SEP-97',                2670,       30.73,      19.75);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.58, '21-SEP-97',                 513,        19.6,      18.42);
insert into stocks values ('WBTK', 'Webbe Transport',      31.25, '22-SEP-97',                1721,       31.28,      24.26);
insert into stocks values ('DYTY', 'Dinosaur Toys',       7.15,  '22-SEP-97',                3708,        7.31,       5.59);
insert into stocks values ('GUIG', 'GUI Intl.',           36.33, '22-SEP-97',                 258,       37.86,       26.5);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.79, '22-SEP-97',                 596,       14.83,      14.41);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.2,  '22-SEP-97',                3279,        12.2,      11.42);
insert into stocks values ('ORCL', 'Oracle Corp.',        73.02, '22-SEP-97',                2073,       73.11,       49.4);
insert into stocks values ('VICA', 'Victoria Apparel',    43.82, '22-SEP-97',                1135,       43.84,      36.42);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '22-SEP-97',                3292,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               33.21, '22-SEP-97',                1374,        33.9,      28.12);
insert into stocks values ('CSCO', 'Cisco Systems',       28.96, '19-SEP-97',                4010,       30.18,      19.64);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.21, '19-SEP-97',                1876,        19.60,    18.42);
insert into stocks values ('WBTK', 'Webbe Transport',      30.07, '19-SEP-97',                4199,       30.68,    24.14);
insert into stocks values ('DYTY', 'Dinosaur Toys',       7.17,  '19-SEP-97',                3020,        7.17,     5.56);
insert into stocks values ('GUIG', 'GUI Intl.',           32.97, '19-SEP-97',                 318,       35.04,     25.94);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.83, '19-SEP-97',                2019,       14.83,     14.41);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   12.14, '19-SEP-97',                4953,        12.20,    11.42);
insert into stocks values ('ORCL', 'Oracle Corp.',        68.97, '19-SEP-97',                1707,       68.97,    48.57);
insert into stocks values ('VICA', 'Victoria Apparel',    42.57, '19-SEP-97',                 727,       42.58,  36.16);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '19-SEP-97',                4538,       27.03,     27.01);
insert into stocks values ('VLVO', 'Volvo',               31.95, '19-SEP-97',                2581,       33.27,     28);
insert into stocks values ('CSCO', 'Cisco Systems',       30.72, '20-SEP-97',                1951,       30.73,    19.75);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.59, '20-SEP-97',                 485,        19.6, 18.42);
insert into stocks values ('GUIG', 'GUI Intl.',           33.09, '15-SEP-97',                 222,       33.09,  25.55);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.67, '15-SEP-97',                1467,       14.71,   14.39);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.9,  '15-SEP-97',                2739,       12.02,  11.38);
insert into stocks values ('ORCL', 'Oracle Corp.',        63.92, '15-SEP-97',                2755,       65.26, 47.83);
insert into stocks values ('VICA', 'Victoria Apparel',    40.16, '15-SEP-97',                 990,       40.59, 35.77);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '15-SEP-97',                4353,       27.03,    27.01);
insert into stocks values ('VLVO', 'Volvo',               32,    '15-SEP-97',                 635,       32.02,  27.75);
insert into stocks values ('CSCO', 'Cisco Systems',       27.92, '15-SEP-97',                1859,       27.93,    19.19);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.22, '15-SEP-97',                 461,       19.22,   18.35);
insert into stocks values ('WBTK', 'Webbe Transport',      30.11, '15-SEP-97',                2526,       30.11,   24.02);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.13, '15-SEP-97',                3654,        6.64,   5.46);
insert into stocks values ('GUIG', 'GUI Intl.',           33.72, '16-SEP-97',                 321,       34.41,    25.81);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.71, '16-SEP-97',                 413,       14.71,    14.39);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.96, '16-SEP-97',                1703,       12.02,   11.38);
insert into stocks values ('ORCL', 'Oracle Corp.',        65.15, '16-SEP-97',                3397,       66.48,  48.07);
insert into stocks values ('VICA', 'Victoria Apparel',    41.38, '16-SEP-97',                1161,       41.38,  35.92);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '16-SEP-97',                5047,       27.03,     27.01);
insert into stocks values ('VLVO', 'Volvo',               31.99, '16-SEP-97',                 672,       32.64,  27.87);
insert into stocks values ('CSCO', 'Cisco Systems',       27.34, '16-SEP-97',                2543,       27.93,     19.19);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.22, '16-SEP-97',                 488,       19.22,   18.35);
insert into stocks values ('WBTK', 'Webbe Transport',      28.92, '16-SEP-97',                3333,       30.11,   24.02);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.64, '16-SEP-97',                2140,       6.64,   5.46);
insert into stocks values ('GUIG', 'GUI Intl.',           30.04, '12-SEP-97',                 231,       31.3,   25.19);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.55, '12-SEP-97',                 541,       14.59,   14.37);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.84, '12-SEP-97',                2974,       11.84,  11.34);
insert into stocks values ('ORCL', 'Oracle Corp.',        60.39, '12-SEP-97',                1880,       60.48,  46.87);
insert into stocks values ('VICA', 'Victoria Apparel',    39.82, '12-SEP-97',                1029,       39.84,     35.62);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '12-SEP-97',                2984,       27.03,     27.01);
insert into stocks values ('GUIG', 'GUI Intl.',           31.86, '13-SEP-97',                 198,       31.86,      25.3);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.67, '13-SEP-97',                1142,       14.67,      14.38);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.9,  '13-SEP-97',                5177,        11.9,      11.36);
insert into stocks values ('ORCL', 'Oracle Corp.',        59.13, '13-SEP-97',                1815,       61.6,       47.1);
insert into stocks values ('VICA', 'Victoria Apparel',    39.4,  '13-SEP-97',                1340,        39.84,      35.62);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '13-SEP-97',                3932,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               32.02, '13-SEP-97',                1683,       32.02,      27.75);
insert into stocks values ('CSCO', 'Cisco Systems',       26.87, '13-SEP-97',                3575,       27.43,     19.09);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  19.22, '13-SEP-97',                1224,       19.22,      18.35);
insert into stocks values ('WBTK', 'Webbe Transport',      28.95, '13-SEP-97',                2438,       28.98,       23.8);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.13, '13-SEP-97',                5404,        6.26,       5.38);
insert into stocks values ('GUIG', 'GUI Intl.',           29.97, '14-SEP-97',                 303,       31.86,       25.3);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.71, '14-SEP-97',                1923,       14.71,      14.39);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.96, '14-SEP-97',                4717,       12.02,      11.38);
insert into stocks values ('ORCL', 'Oracle Corp.',        62.73, '14-SEP-97',                1624,       62.73,      47.32);
insert into stocks values ('VICA', 'Victoria Apparel',    40.58, '14-SEP-97',                 692,       40.59,      35.77);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '14-SEP-97',                4324,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               30.75, '14-SEP-97',                2458,       32.02,      27.75);
insert into stocks values ('CSCO', 'Cisco Systems',       26.31, '14-SEP-97',                3816,      27.43,      19.09);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.84, '14-SEP-97',                1787,       19.22,      18.35);
insert into stocks values ('WBTK', 'Webbe Transport',      28.94, '14-SEP-97',                3999,       29.53,      23.91);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.64, '14-SEP-97',                2876,        6.64,       5.46);
insert into stocks values ('VLVO', 'Volvo',               29.61, '09-SEP-97',                2341,       30.83,      27.51);
insert into stocks values ('CSCO', 'Cisco Systems',       23.91, '09-SEP-97',                3635,       24.93,      18.59);
insert into stocks values ('VLVO', 'Volvo',               30.77, '12-SEP-97',                1245,       31.42,      27.63);
insert into stocks values ('CSCO', 'Cisco Systems',       26.36, '12-SEP-97',                2428,        26.9,      18.98);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.84, '12-SEP-97',                 906,       19.03,      18.31);
insert into stocks values ('WBTK', 'Webbe Transport',      28.96, '12-SEP-97',                1561,       28.98,       23.8);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.13, '12-SEP-97',                3364,        6.26,       5.38);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.13, '02-SEP-97',                 820,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      26.82, '02-SEP-97',                1416,       26.82,      23.36);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.28, '02-SEP-97',                3052,        5.83,       5.39);
insert into stocks values ('GUIG', 'GUI Intl.',           24.79, '02-SEP-97',                 209,        28.4,      24.61);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.31, '02-SEP-97',                 491,        14.5,      14.35);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.48, '02-SEP-97',                2697,       11.48,      11.27);
insert into stocks values ('ORCL', 'Oracle Corp.',        49.94, '02-SEP-97',                1704,       49.96,      44.77);
insert into stocks values ('VICA', 'Victoria Apparel',    36.13, '02-SEP-97',                 933,       36.23,      34.89);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '02-SEP-97',                2704,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               28.54, '02-SEP-97',                1131,          29,      27.14);
insert into stocks values ('CSCO', 'Cisco Systems',       21.76, '02-SEP-97',                2201,       22.28,      18.06);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.49, '05-SEP-97',                 418,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      27.89, '05-SEP-97',                2291,       27.89,      23.58);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.26, '05-SEP-97',                3312,        5.83,       5.29);
insert into stocks values ('GUIG', 'GUI Intl.',           27.35, '05-SEP-97',                 202,        28.4,      24.61);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.43, '05-SEP-97',                1331,        14.5,      14.35);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.54, '05-SEP-97',                2484,       11.66,      11.31);
insert into stocks values ('ORCL', 'Oracle Corp.',        52.88, '05-SEP-97',                2498,       53.98,      45.57);
insert into stocks values ('VICA', 'Victoria Apparel',    36.46, '05-SEP-97',                 900,       36.85,      35.02);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '05-SEP-97',                3947,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               29.67, '05-SEP-97',                 575,       29.69,      27.28);
insert into stocks values ('CSCO', 'Cisco Systems',       23.07, '05-SEP-97',                1683,       23.08,      18.22);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.49, '06-SEP-97',                 443,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      26.78, '06-SEP-97',                3023,       27.89,      23.58);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.7,  '06-SEP-97',                1940,        5.83,       5.29);
insert into stocks values ('GUIG', 'GUI Intl.',           27.88, '06-SEP-97',                 293,       28.45,      24.62);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.47, '06-SEP-97',                 374,        14.5,      14.35);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.6,  '06-SEP-97',                1544,       11.66,      11.31);
insert into stocks values ('ORCL', 'Oracle Corp.',        53.9,  '06-SEP-97',                3080,          55,      45.78);
insert into stocks values ('VICA', 'Victoria Apparel',    37.56, '06-SEP-97',                1053,       37.56,      35.16);
insert into stocks values ('MSFT', 'Microsoft',           22.04, '06-SEP-97',               14575,       22.04,      19.01);
insert into stocks values ('VLVO', 'Volvo',               29.65, '06-SEP-97',                 610,       30.26,       27.4);
insert into stocks values ('CSCO', 'Cisco Systems',       22.59, '06-SEP-97',                2304,       23.08,      18.22);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.48, '07-SEP-97',                 862,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      27.87, '07-SEP-97',                1487,       27.89,      23.58);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.68, '07-SEP-97',                3204,        5.83,       5.29);
insert into stocks values ('GUIG', 'GUI Intl.',           27.3,  '07-SEP-97',                 223,       28.45,      24.62);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.43, '07-SEP-97',                 515,        14.5,      14.35);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.66, '07-SEP-97',                2832,       11.66,      11.31);
insert into stocks values ('ORCL', 'Oracle Corp.',        54.94, '07-SEP-97',                1791,          55,      45.78);
insert into stocks values ('VICA', 'Victoria Apparel',    37.94, '07-SEP-97',                 980,       37.94,      35.24);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '07-SEP-97',                2839,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               29.64, '07-SEP-97',                1186,       30.26,       27.4);
insert into stocks values ('CSCO', 'Cisco Systems',       23.96, '07-SEP-97',                2311,       24.45,      18.49);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.85, '08-SEP-97',                1166,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      27.86, '08-SEP-97',                2321,       27.89,      23.58);
insert into stocks values ('DYTY', 'Dinosaur Toys',        5.68, '08-SEP-97',                5146,        5.83,       5.29);
insert into stocks values ('GUIG', 'GUI Intl.',           28.97, '08-SEP-97',                 186,       28.97,      24.72);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.55, '08-SEP-97',                1087,       14.55,      14.36);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.72, '08-SEP-97',                4929,       11.72,      11.32);
insert into stocks values ('ORCL', 'Oracle Corp.',        53.8,  '08-SEP-97',                1730,       56.04,      45.98);
insert into stocks values ('VICA', 'Victoria Apparel',    37.56, '08-SEP-97',                1276,       37.94,      35.24);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '08-SEP-97',                3742,       27.03,      27.01);
insert into stocks values ('VLVO', 'Volvo',               30.83, '08-SEP-97',                1603,       30.83,      27.51);
insert into stocks values ('CSCO', 'Cisco Systems',       24.42, '08-SEP-97',                3403,       24.93,      18.59);
insert into stocks values ('ALCB', 'Alaska Corned Beef',  18.47, '09-SEP-97',                1702,       18.89,      18.28);
insert into stocks values ('WBTK', 'Webbe Transport',      27.85, '09-SEP-97',                3808,       28.42,      23.68);
insert into stocks values ('DYTY', 'Dinosaur Toys',        6.15, '09-SEP-97',                2738,        6.15,       5.36);
insert into stocks values ('GUIG', 'GUI Intl.',           27.25, '09-SEP-97',                 287,       28.97,      24.72);
insert into stocks values ('ULTM', 'Ultimate Lighting',   14.59, '09-SEP-97',                1830,       14.59,      14.37);
insert into stocks values ('OJSP', 'OJ Sporting Goods',   11.78, '09-SEP-97',                4492,       11.84,      11.34);
insert into stocks values ('ORCL', 'Oracle Corp.',        57.07, '09-SEP-97',                1549,       57.07,      46.19);
insert into stocks values ('VICA', 'Victoria Apparel',    38.69, '09-SEP-97',                 659,        38.7,      35.39);
insert into stocks values ('MSFT', 'Microsoft',           27.02, '09-SEP-97',                4115,       27.03,      27.01);




CREATE TABLE CUSTOMERS (         ID   NUMBER NOT NULL,
 FIRST_NAME                      VARCHAR2(20) NOT NULL,
 LAST_NAME                       VARCHAR2(20) NOT NULL,
 ADDRESS_LINE_1                           VARCHAR2(30),
 ADDRESS_LINE_2                           VARCHAR2(30),
 ADDRESS_LINE_3                           VARCHAR2(30),
 PHONE_NUMBER                             VARCHAR2(15),
 FAX_NUMBER                               VARCHAR2(15) NOT NULL,
 COMM_PAID_YTD                            NUMBER(9,2) NOT NULL,
 ACCOUNT_BALANCE                          NUMBER(9,2) NOT NULL,
 COMMENTS                                 VARCHAR2(240));


insert into customers values (10,'Natarajan', 'Iyer', '9994 Foster Street', 'Foster City, CA 90003',
    NULL,'415-506-5001','415-506-3999',0,90000, NULL);                
												    
insert into customers values (20,'Mike', 'Kanaley', '9989 Cross Street', 'Bealville, CA 90006', 
NULL, '415-506-5002', '415-506-3998', 0,80000, NULL );
												    
insert into customers values (30, 'Holway', 'Kalikow', '9984 Eye Street', 'Caliente, CA 90009', 
NULL, '415-506-5003', '415-506-3997', 0, 70000, NULL );                
												    
insert into customers values (40, 'Earl', 'Blair', '9979 Colson Blvd.', 'Mojave, CA 90012', 
NULL, '415-506-5004 ', '415-506-3996', 0, 60000, NULL );
												    
insert into customers values (50, 'Alvin', 'Law', '9974 Walker Street', 'Tehachapi, CA 90015', 
NULL, '415-506-5005', '415-506-3995', 0, 50000, NULL );
												    
insert into customers values (60, 'Charles', 'Weiss', '869 Ulloa Street', 'Redwood City, CA 90018', 
NULL, '415-506-5006', '415-506-3994', 0, 40000, NULL );
												    
insert into customers values (70, 'Vincent', 'Morello', '9964 Santa Fe Avenue', 'Albany, CA 90021', 
NULL, '415-506-5007', '415-506-3993', 0, 30000, NULL );
												    
insert into customers values (90, 'Clifford', 'Godwin', '9884 Sixth Street', 'Berkeley, CA 90069', 
NULL, '415-506-5023', '415-506-3977', 0, 70000, NULL );
												    
insert into customers values (100, 'Jagdish', 'Pamnani', '9879 Detail Way', 'San Luis Obispo, CA 98072', 
NULL, '415-506-5024', '415-506-3976', 0, 60000, NULL );

insert into customers values (110, 'Leonard', 'Towle', '23 Western Avenue', 'Moapa, NV 89943', 
NULL, '415-506-5025', '415-506-3975',0, 50000, NULL);

insert into customers values (120, 'Ben', 'King', '8320 Helper Blvd.', 'Bakersfield, CA 90078', 
NULL, '415-506-5026', '415-506-3974', 0, 40000, NULL);
												    
insert into customers values (130, 'Maryam', 'Saffari', '9864 Milwaukee Ave.' ,'Minot, SD 65601', 
NULL, '415-506-5027', '415-506-3973', 0, 30000, NULL);                  
												    
insert into customers values (140, 'Arturo', 'Zacarias', '9859 Picasso Street', 'Havre, MT 66184', 
NULL, '415-506-5028', '415-506-3972',0, 20000, NULL);
												    
insert into customers values (80, 'Tim', 'Jones', '2380 Sunset Boulevard', 'San Francisco, CA 94109',
NULL,'415-898-5363', '415-898-5334', 23400, 12300,                 
'Tim prefers to trade in NASDAQ stock.');
												    


CREATE TABLE PORTFOLIO (
	CUSTOMER_ID                     NUMBER NOT NULL, 
	STOCK_SYMBOL                    VARCHAR2(10) NOT NULL,
	SHARES_OWNED                    NUMBER NOT NULL);


REM CUSTOMER_ID STOCK_SYMB SHARES_OWNED                                                                 
REM ----------- ---------- ------------                                                                 
insert into portfolio values (10, 'MSFT', 2359);
insert into portfolio values (10, 'CSCO', 2037);
insert into portfolio values (10, 'GUIG', 111);
insert into portfolio values (20, 'DYTY', 3937);
insert into portfolio values (20, 'ULTM', 961);
insert into portfolio values (20, 'VLVO', 1203);
insert into portfolio values (30, 'ALCB', 2330);
insert into portfolio values (30, 'VICA', 989);
insert into portfolio values (30, 'GUIG', 264);
insert into portfolio values (40, 'DYTY', 2295);
insert into portfolio values (40, 'ORCL', 1533);
insert into portfolio values (40, 'VLVO', 3205);
insert into portfolio values (50, 'WBTK', 3674);
insert into portfolio values (50, 'OJSP', 4589);
insert into portfolio values (50, 'VICA', 573);
insert into portfolio values (60, 'VICA', 786);
insert into portfolio values (60, 'CSCO', 2037);
insert into portfolio values (60, 'GUIG', 111);
insert into portfolio values (70, 'DYTY', 3937);
insert into portfolio values (70, 'OJSP', 2674);
insert into portfolio values (70, 'VICA', 333);
insert into portfolio values (80, 'ULTM', 1458);
insert into portfolio values (90, 'DYTY', 2295);
insert into portfolio values (90, 'GUIG', 111);
insert into portfolio values (90, 'MSFT', 2625);
insert into portfolio values (100, 'MSFT', 1722);
insert into portfolio values (100, 'CSCO', 1834);
insert into portfolio values (100, 'ORCL', 1970);
insert into portfolio values (110, 'MSFT', 2359);
insert into portfolio values (110, 'WBTK', 4076);
insert into portfolio values (110, 'ALCB', 876);                                                                
insert into portfolio values (120, 'MSFT', 987);                                                              
insert into portfolio values (120, 'ORCL', 1148);                                                             
insert into portfolio values (120, 'CSCO', 2301);                                                           
insert into portfolio values (130, 'ORCL', 1573);                                                         
insert into portfolio values (130, 'GUIG', 293);
insert into portfolio values (130, 'VICA', 989);
insert into portfolio values (140, 'OJSP', 4076);
insert into portfolio values (140, 'ULTM', 961);
insert into portfolio values (140, 'CSCO', 769);




CREATE TABLE INDCAT ( 
			SYMBOL       VARCHAR2(10),
			CATEGORY     VARCHAR2(20));


insert into indcat values('ORCL','Technology');
insert into indcat values('MSFT','Technology');
insert into indcat values('CSCO','Technology');
insert into indcat values('GUIG','Technology');

insert into indcat values('DYTY','Retail');
insert into indcat values('VICA','Retail');
insert into indcat values('OJSP','Retail');
insert into indcat values('ALCB','Retail');
insert into indcat values('ULTM','Retail');

insert into indcat values('VLVO','Transportation');
insert into indcat values('WBTK','Transportation');
REM
REM Tables for Intermodal Demo Report 
REM 


drop table containers;
CREATE TABLE containers (
		KEY         VARCHAR2(50), 
		REPNO	      VARCHAR2(50),
		CLASSID	    NUMBER,
		STATUS	    NUMBER,
		DOCKLOC	    VARCHAR2(50),
		PORTID	    NUMBER);

REM Oakland 45' footers
insert into containers values('45D','APLU 453128',9510,1,'G41',1);
insert into containers values('45D','APLU 450112',9510,1,'G41',1);
insert into containers values('45D','APLU 453106',9520,1,'G42',1);
insert into containers values('45D','APLU 452300',9520,1,'G42',1);
insert into containers values('45D','GSTU 234026',9510,1,'G44',1);
insert into containers values('45D','APLU 450017',9520,1,'G43',1);

REM Oakland 40' footers
insert into containers values('40D','GSLU 411154',4300,1,'H20',1);
insert into containers values('40D','RTTU 420060',4300,1,'H22',1);
insert into containers values('40D','GSLU 411039',4300,1,'H23',1);
insert into containers values('40D','APLU 701492',4300,1,'C42',1);
insert into containers values('40R','APLU 260466',4332,1,'H23',1);
insert into containers values('40R','GSLU 260003',4332,1,'H20',1);
insert into containers values('40D','RTTU 420011',4300,1,'H22',1);
insert into containers values('40D','GSLU 411083',4300,1,'C23',1);
insert into containers values('40D','APLU 701401',4300,1,'H42',1);

REM Oakland 20 footers
insert into containers values('20D','GSLU 210202',2210,1,'A14',1);
insert into containers values('20D','APLU 220361',2210,1,'A14',1);
insert into containers values('20D','GSLU 210061',2210,1,'B16',1);

REM Oakland Misc 
insert into containers values('20F','GSLU 110202',2250,1,'F01',1);
insert into containers values('20F','GSLU 110203',2250,1,'F01',1);
insert into containers values('40F','GSLU 140006',4250,1,'F02',1);

REM Long Beach 45' footers
insert into containers values('45D','GSLU 450112',9510,1,'G41',2);
insert into containers values('45D','GSLU 453174',9510,1,'G41',2);
insert into containers values('45D','GSLU 453106',9520,1,'G42',2);
insert into containers values('45D','GSLU 452300',9520,1,'G42',2);
insert into containers values('45D','GSTU 234026',9510,1,'G44',2);
insert into containers values('45D','GSLU 450017',9520,1,'G43',2);

REM Long Beach 40' footers
insert into containers values('40D','GSLU 410183',4300,1,'H20',2);
insert into containers values('40D','RTTU 420059',4300,1,'H22',2);
insert into containers values('40D','GSLU 411038',4300,1,'H23',2);
insert into containers values('40D','APLU 701491',4310,1,'C42',2);
insert into containers values('40R','APLU 260465',4332,1,'H23',2);
insert into containers values('40R','GSLU 260002',4332,1,'H20',2);
insert into containers values('40R','GSLU 260003',4332,1,'H20',2);
insert into containers values('40R','GSLU 260004',4332,1,'H20',2);
insert into containers values('40R','GSLU 260005',4332,1,'H20',2);
insert into containers values('40R','GSLU 260006',4332,1,'H20',2);
insert into containers values('40R','GSLU 260008',4332,1,'H20',2);
insert into containers values('40R','GSLU 260012',4332,1,'H20',2);
insert into containers values('40D','RTTU 420010',4300,1,'H22',2);
insert into containers values('40D','GSLU 411082',4300,1,'C23',2);
insert into containers values('40D','APLU 701402',4310,1,'H42',2);
insert into containers values('40D','APLU 701404',4310,1,'H42',2);
insert into containers values('40D','APLU 701405',4310,1,'H42',2);
insert into containers values('40D','APLU 701412',4310,1,'H42',2);

REM Long Beach 20 footers
insert into containers values('20D','RPLU 220369',2210,1,'A14',2);
insert into containers values('20D','GSLU 210062',2210,1,'B16',2);
insert into containers values('20D','GSLU 210203',2210,1,'A14',2);
insert into containers values('20D','GSLU 210201',2210,1,'A14',2);
insert into containers values('20D','APLU 220362',2210,1,'A14',2);
insert into containers values('20D','GSLU 210064',2210,1,'B16',2);
insert into containers values('20D','GSLU 210070',2210,1,'B16',2);
insert into containers values('20D','GSLU 210071',2210,1,'B16',2);
insert into containers values('20D','GSLU 210079',2210,1,'B16',2);
insert into containers values('20D','GSLU 210080',2210,1,'B16',2);
insert into containers values('20D','GSLU 210088',2210,1,'B16',2);

REM Long Beach Misc 
insert into containers values('20F','GSLU 110203',2250,1,'F01',2);
insert into containers values('20F','GSLU 110206',2250,1,'F01',2);
insert into containers values('20F','GSLU 110211',2250,1,'F01',2);
insert into containers values('20F','GSLU 110259',2250,1,'F01',2);
insert into containers values('40F','GSLU 140002',4250,1,'F02',2);
insert into containers values('40F','GSLU 140003',4250,1,'F02',2);
insert into containers values('40F','GSLU 140004',4250,1,'F02',2);


REM Seattle 45' footers
insert into containers values('45D','GSLU 450212',9510,1,'G41',4);
insert into containers values('45D','GSLU 453274',9510,1,'G41',4);
insert into containers values('45D','GSLU 453206',9520,1,'G42',4);
insert into containers values('45D','GSLU 452400',9520,1,'G42',4);
insert into containers values('45D','GSTU 234126',9510,1,'G44',4);
insert into containers values('45D','GSLU 450117',9520,1,'G43',4);

REM Seattle 40' footers
insert into containers values('40D','GSLU 410283',4300,1,'H20',4);
insert into containers values('40D','RTTU 420159',4300,1,'H22',4);
insert into containers values('40D','RTTU 420160',4300,1,'H22',4);
insert into containers values('40D','RTTU 420161',4300,1,'H22',4);
insert into containers values('40D','RTTU 420182',4300,1,'H22',4);
insert into containers values('40D','RTTU 420373',4300,1,'H22',4);
insert into containers values('40D','GSLU 411138',4300,1,'H23',4);
insert into containers values('40D','APLU 701591',4310,1,'C42',4);
insert into containers values('40R','APLU 260565',4332,1,'H23',4);
insert into containers values('40R','GSLU 260102',4332,1,'H20',4);
insert into containers values('40R','GSLU 260103',4332,1,'H20',4);
insert into containers values('40R','GSLU 260104',4332,1,'H20',4);
insert into containers values('40R','GSLU 260105',4332,1,'H20',4);
insert into containers values('40R','GSLU 260106',4332,1,'H20',4);
insert into containers values('40R','GSLU 260108',4332,1,'H20',4);
insert into containers values('40R','GSLU 260112',4332,1,'H20',4);
insert into containers values('40D','RTTU 420110',4300,1,'H22',4);
insert into containers values('40D','GSLU 411182',4300,1,'C23',4);
insert into containers values('40D','APLU 701502',4310,1,'H42',4);
insert into containers values('40D','APLU 701504',4310,1,'H42',4);
insert into containers values('40D','APLU 701505',4310,1,'H42',4);
insert into containers values('40D','APLU 701512',4310,1,'H42',4);
insert into containers values('40R','GSLU 260114',4332,1,'H23',4);
insert into containers values('40R','GSLU 260115',4332,1,'H23',4);
insert into containers values('40R','GSLU 260116',4332,1,'H20',4);
insert into containers values('40R','GSLU 260118',4332,1,'H20',4);
insert into containers values('40R','GSLU 260125',4332,1,'H22',4);

REM Seattle 20 footers
insert into containers values('20D','RPLU 220469',2210,1,'A14',4);
insert into containers values('20D','GSLU 210162',2210,1,'B16',4);
insert into containers values('20D','GSLU 210303',2210,1,'A14',4);
insert into containers values('20D','GSLU 210301',2210,1,'A14',4);
insert into containers values('20D','APLU 220462',2210,1,'A14',4);
insert into containers values('20D','GSLU 210164',2210,1,'B16',4);
insert into containers values('20D','GSLU 210170',2210,1,'B16',4);
insert into containers values('20D','GSLU 210171',2210,1,'B16',4);
insert into containers values('20D','GSLU 210179',2210,1,'B16',4);
insert into containers values('20D','GSLU 210186',2210,1,'B16',4);
insert into containers values('20D','GSLU 210187',2210,1,'B16',4);

REM Seattle Misc 
insert into containers values('20F','GSLU 110215',2250,1,'F01',4);
insert into containers values('20F','GSLU 110246',2250,1,'F01',4);
insert into containers values('20F','GSLU 110217',2250,1,'F01',4);
insert into containers values('20F','GSLU 110249',2250,1,'F01',3);


REM Portland 45' footers
insert into containers values('45D','GSLU 452501',9520,1,'G42',3);
insert into containers values('45D','GSTU 234227',9510,1,'G44',3);
insert into containers values('45D','GSLU 450318',9520,1,'G43',3);

REM Portland 40' footers
insert into containers values('40D','GSLU 410284',4300,1,'H20',3);
insert into containers values('40D','RTTU 420260',4300,1,'H22',3);
insert into containers values('40D','RTTU 420271',4300,1,'H22',3);
insert into containers values('40D','GSLU 411239',4300,1,'H23',3);
insert into containers values('40D','APLU 701692',4310,1,'C42',3);
insert into containers values('40R','APLU 260667',4332,1,'H23',3);
insert into containers values('40R','GSLU 260203',4332,1,'H20',3);
insert into containers values('40R','GSLU 260204',4332,1,'H20',3);
insert into containers values('40D','GSLU 411285',4300,1,'C23',3);
insert into containers values('40D','APLU 701603',4310,1,'H42',3);
insert into containers values('40D','APLU 701604',4310,1,'H42',3);
insert into containers values('40D','APLU 701605',4310,1,'H42',3);
insert into containers values('40D','APLU 701613',4310,1,'H42',3);

REM Portland 20 footers
insert into containers values('20D','RPLU 220469',2210,1,'A14',3);
insert into containers values('20D','GSLU 210187',2210,1,'B16',3);

REM Portland Misc 
insert into containers values('20F','GSLU 110215',2250,1,'F01',3);



REM Vancouver,BC 45' footers
insert into containers values('45D','GSLU 450212',9510,1,'G41',5);
insert into containers values('45D','GSLU 453274',9510,1,'G41',5);
insert into containers values('45D','GSLU 453206',9520,1,'G42',5);
insert into containers values('45D','GSLU 452400',9520,1,'G42',5);
insert into containers values('45D','GSLU 450117',9520,1,'G43',5);

REM Vancouver,BC 40' footers
insert into containers values('40D','GSLU 410283',4300,1,'H20',5);
insert into containers values('40D','RTTU 420159',4300,1,'H22',5);
insert into containers values('40D','RTTU 420160',4300,1,'H22',5);
insert into containers values('40D','RTTU 420161',4300,1,'H22',5);
insert into containers values('40D','RTTU 420182',4300,1,'H22',5);
insert into containers values('40D','APLU 701591',4310,1,'C42',5);
insert into containers values('40R','APLU 260565',4332,1,'H23',5);
insert into containers values('40R','GSLU 260102',4332,1,'H24',5);
insert into containers values('40R','GSLU 260103',4332,1,'H24',5);
insert into containers values('40R','GSLU 260104',4332,1,'H24',5);
insert into containers values('40R','GSLU 260105',4332,1,'H20',5);
insert into containers values('40R','GSLU 260106',4332,1,'H20',5);
insert into containers values('40R','GSLU 260108',4332,1,'H22',5);
insert into containers values('40R','GSLU 260112',4332,1,'H20',5);
insert into containers values('40D','RTTU 420110',4300,1,'H22',5);
insert into containers values('40D','GSLU 411182',4300,1,'C23',5);
insert into containers values('40D','APLU 701502',4310,1,'H42',5);
insert into containers values('40D','APLU 701504',4310,1,'H42',5);
insert into containers values('40D','APLU 701505',4310,1,'H42',5);
insert into containers values('40D','APLU 701512',4310,1,'H42',5);

REM Vancouver,BC 20 footers
insert into containers values('20D','RPLU 220469',2210,1,'A14',5);
insert into containers values('20D','GSLU 210162',2210,1,'B16',5);
insert into containers values('20D','GSLU 210303',2210,1,'A14',5);
insert into containers values('20D','GSLU 210301',2210,1,'A14',5);
insert into containers values('20D','APLU 220462',2210,1,'A14',5);
insert into containers values('20D','GSLU 210164',2210,1,'B16',5);
insert into containers values('20D','GSLU 210170',2210,1,'B16',5);
insert into containers values('20D','GSLU 210171',2210,1,'B16',5);
insert into containers values('20D','GSLU 210179',2210,1,'B16',5);
insert into containers values('20D','GSLU 210186',2210,1,'B16',5);
insert into containers values('20D','GSLU 210187',2210,1,'B16',5);

REM Vancouver Misc 
insert into containers values('20F','GSLU 110244',2250,1,'F01',5);
insert into containers values('20F','GSLU 110216',2250,1,'F01',5);
insert into containers values('20F','GSLU 110209',2250,1,'F01',5);


drop table conclass;

CREATE TABLE conclass (
		CLASSID		NUMBER,
		HTF		NUMBER,
		HTI		NUMBER,
		TWL		NUMBER,
		GWL		NUMBER,
		TEU		NUMBER,
		CCAP		NUMBER,
		NOTES		VARCHAR2(50)
		);

REM 45 footers
insert into conclass values(9510,9,6,8400,67200,2.25,2594,'dry cargo');
insert into conclass values(9520,9,6,8400,67200,2.25,2594,'insulated');

REM 40 footers
insert into conclass values(4300,8,6,8200,66500,2,2290,'dry cargo');
insert into conclass values(4310,9,6,8400,67000,2,2306,'high cube');
insert into conclass values(4332,9,6,8400,67000,2,2306,'refrigerated');
insert into conclass values(2200,8,6,4960,52920,1,2290,'dry cargo');
insert into conclass values(2210,8,6,4410,51300,1,2270,'dry cargo');

REM flat rack containers
insert into conclass values(2250,8,6,4410,51300,1,2270,'flat rack');
insert into conclass values(4250,8,6,4410,51300,1,2270,'load dividers');

drop table conlabel;
create table conlabel
		( key	varchar2(50),
		  title varchar2(100));

insert into conlabel values ('20D','20-foot');
insert into conlabel values ('40D','40-foot');
insert into conlabel values ('45D','45-foot');
insert into conlabel values ('40F','40-foot Flat Rack');
insert into conlabel values ('40R','40ft. Refrigerated');
insert into conlabel values ('20F','20-foot Flat Rack');

REM  to customize this demo to your locale, simply modify the values below.
REM
drop table portdesc;
create table portdesc (
		portid	number,
		locname	varchar2(100));

insert into portdesc values (1, 'Oakland');
insert into portdesc values (2, 'Long Beach');
insert into portdesc values (3, 'Portland');
insert into portdesc values (4, 'Seattle');
insert into portdesc values (5, 'Vancouver,BC');

create table video_category_by_qtr ( quarter varchar2(5),
		   sales_region     varchar2(20),
		   state 	    varchar2(3),
		   city		    varchar2(30),
		   product_category varchar2(20),
		   total_sales       number(38,2),
		   total_cost        number(38,2),
		   total_profit      number(38,2));
		   

insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Action',973.17,280.2,692.97);              
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Childrens',182.45,72.98,109.47);           
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Comedy',500.4,162.58,337.82);              
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Drama',415.71,155.73,259.98);              
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Horror',480.72,144.99,335.73);             
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Romantic Comedy',1471.63,438.01,1033.63);  
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Sci-Fi',73.15,29.26,43.89);                
insert into video_category_by_qtr values('11-95','Central','IL','Chicago','Thriller',1221.23,367.45,853.78);          
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Action',3355.51,1183.45,2172.06);       
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Childrens',1087.58,435.55,652.03);      
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Comedy',2031.6,746.96,1284.64);         
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Drama',1347.9,591.71,756.19);           
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Horror',1110.59,432.63,677.96);         
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Romantic Comedy',2006.5,750.71,1255.79);
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Sci-Fi',1791.32,681.12,1110.2);         
insert into video_category_by_qtr values('11-95','Central','KY','Louisville','Thriller',2865.58,1057.36,1808.22);     
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Action',571.4,186.84,384.56);          
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Childrens',693.36,217.53,475.83);      
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Comedy',67.89,23.64,44.25);            
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Drama',319.54,124.3,195.24);           
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Horror',535.17,159.23,375.94);         
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Romantic Comedy',471.78,158.98,312.8); 
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Sci-Fi',310.93,106.78,204.15);         
insert into video_category_by_qtr values('11-95','Central','MN','Minneapolis','Thriller',1123.21,341.26,781.95);      
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Action',2076.93,636.49,1440.44);         
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Childrens',1732.42,534.64,1197.78);      
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Comedy',1124.38,362.76,761.62);          
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Drama',960.67,352.6,608.07);             
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Horror',333.47,123.64,209.82);           
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Romantic Comedy',1061.42,365.38,696.04); 
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Sci-Fi',711.41,250.5,460.91);            
insert into video_category_by_qtr values('11-95','Central','MO','St. Louis','Thriller',2498.84,767.24,1731.61);       
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Action',2420.24,940.28,1479.96);        
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Childrens',1783.09,715.63,1067.47);     
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Comedy',2694.29,1045.91,1648.39);       
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Drama',1483.49,706.56,776.93);          
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Horror',1208.14,530.4,677.74);          
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Romantic Comedy',2189.63,887.96,1301.68) ;                                                                                                   
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Sci-Fi',2297.57,888.32,1409.26);        
insert into video_category_by_qtr values('11-95','Central','OH','Cincinnati','Thriller',3318.58,1308.01,2010.58);     
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Action',421.72,132.2,289.52);            
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Childrens',297.98,96.52,201.46);         
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Comedy',423.83,127.33,296.5);            
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Drama',325.1,123.54,201.56);             
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Horror',477.08,148.34,328.74);           
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Romantic Comedy',434.46,131.67,302.79);  
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Sci-Fi',231.66,78,153.66);               
insert into video_category_by_qtr values('11-95','Central','TN','Nashville','Thriller',876.67,264.62,612.05);         
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Action',153.88,52.17,101.71);               
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Childrens',232.45,92.98,139.47);            
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Comedy',253.29,87.24,166.05);               
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Drama',366.6,146.64,219.96);                
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Horror',312.65,101.89,210.76);              
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Romantic Comedy',365.57,118.73,246.85);     
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Sci-Fi',455.64,154.11,301.53);              
insert into video_category_by_qtr values('11-95','Central','TX','Dallas','Thriller',671.7,219.95,451.76);             
insert into video_category_by_qtr values('11-95','East','DC','Washington','Action',2255.71,1063.44,1192.27);          
insert into video_category_by_qtr values('11-95','East','DC','Washington','Childrens',1112.75,572.65,540.1);          
insert into video_category_by_qtr values('11-95','East','DC','Washington','Comedy',2488,1166.59,1321.4);              
insert into video_category_by_qtr values('11-95','East','DC','Washington','Drama',1668.63,916.73,751.89);             
insert into video_category_by_qtr values('11-95','East','DC','Washington','Horror',1707.98,812.88,895.1);             
insert into video_category_by_qtr values('11-95','East','DC','Washington','Romantic Comedy',3038.49,1430.46,1608.03); 
insert into video_category_by_qtr values('11-95','East','DC','Washington','Sci-Fi',852.1,448.68,403.42);              
insert into video_category_by_qtr values('11-95','East','DC','Washington','Thriller',2844.69,1350.02,1494.67);        
insert into video_category_by_qtr values('11-95','East','FL','Miami','Action',365.36,144.25,221.11);                  
insert into video_category_by_qtr values('11-95','East','FL','Miami','Childrens',350.42,154.77,195.64);               
insert into video_category_by_qtr values('11-95','East','FL','Miami','Comedy',374.14,161.91,212.23);                  
insert into video_category_by_qtr values('11-95','East','FL','Miami','Drama',521.76,225.58,296.18);                   
insert into video_category_by_qtr values('11-95','East','FL','Miami','Horror',95.17,45.75,49.42);                     
insert into video_category_by_qtr values('11-95','East','FL','Miami','Romantic Comedy',789.84,310.09,479.75);         
insert into video_category_by_qtr values('11-95','East','FL','Miami','Sci-Fi',193.99,96.3,97.69);                     
insert into video_category_by_qtr values('11-95','East','FL','Miami','Thriller',806.9,344.34,462.55);                 
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Action',1349.39,746.68,602.71);               
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Childrens',1253.42,735.56,517.86);            
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Comedy',1334.08,759.2,574.87);                
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Drama',810.76,542.1,268.66);                  
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Horror',453.07,273.87,179.2);                 
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Romantic Comedy',1262.67,782.39,480.28);      
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Sci-Fi',529.38,351.17,178.21);                
insert into video_category_by_qtr values('11-95','East','GA','Atlanta','Thriller',897.39,550.46,346.93);              
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Action',466.09,110.82,355.28);            
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Childrens',446.29,105.26,341.03);         
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Comedy',434.61,102.1,332.51);             
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Drama',352.01,91.17,260.83);              
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Horror',353.36,82.5,270.86);              
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Romantic Comedy',811.58,180.45,631.14);   
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Sci-Fi',255.52,58.9,196.62);              
insert into video_category_by_qtr values('11-95','East','LA','New Orleans','Thriller',974.72,208.47,766.25);          
insert into video_category_by_qtr values('11-95','East','MA','Boston','Action',1433.12,450.12,982.99);                
insert into video_category_by_qtr values('11-95','East','MA','Boston','Childrens',1571.3,477.23,1094.07);             
insert into video_category_by_qtr values('11-95','East','MA','Boston','Comedy',844.23,270.84,573.39);                 
insert into video_category_by_qtr values('11-95','East','MA','Boston','Drama',666.09,252.36,413.73);                  
insert into video_category_by_qtr values('11-95','East','MA','Boston','Horror',669.66,214.8,454.86);                  
insert into video_category_by_qtr values('11-95','East','MA','Boston','Romantic Comedy',1027.27,339.77,687.5);        
insert into video_category_by_qtr values('11-95','East','MA','Boston','Sci-Fi',609.07,213.42,395.65);                 
insert into video_category_by_qtr values('11-95','East','MA','Boston','Thriller',1169.19,371.1,798.1);                
insert into video_category_by_qtr values('11-95','East','NY','New York','Action',5012.82,1576.43,3436.4);             
insert into video_category_by_qtr values('11-95','East','NY','New York','Childrens',5229.54,1637.94,3591.6);          
insert into video_category_by_qtr values('11-95','East','NY','New York','Comedy',5361.92,1718.94,3642.98);            
insert into video_category_by_qtr values('11-95','East','NY','New York','Drama',3601.47,1345.59,2255.88);             
insert into video_category_by_qtr values('11-95','East','NY','New York','Horror',1782.66,606.39,1176.26);             
insert into video_category_by_qtr values('11-95','East','NY','New York','Romantic Comedy',3881.4,1252.58,2628.82);    
insert into video_category_by_qtr values('11-95','East','NY','New York','Sci-Fi',3018.83,1007.5,2011.32);             
insert into video_category_by_qtr values('11-95','East','NY','New York','Thriller',6656.08,2135.54,4520.54);          
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Action',1740.81,400.88,1339.94);         
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Childrens',1018.46,231.65,786.81);       
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Comedy',1719.04,399.37,1319.67);         
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Drama',621.39,175.86,445.53);            
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Horror',535.55,134.78,400.77);           
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Romantic Comedy',1547.9,357.99,1189.91); 
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Sci-Fi',879.24,215.09,664.15);           
insert into video_category_by_qtr values('11-95','East','PA','Philadelphia','Thriller',1107.51,271.67,835.83);        
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Action',929.23,297.18,632.05);             
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Childrens',579.81,196.74,383.07);          
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Comedy',1124.29,358.24,766.05);            
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Drama',710.23,266.5,443.73);               
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Horror',364.19,138.02,226.18);             
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Romantic Comedy',894.66,299.51,595.15);    
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Sci-Fi',726.84,247.41,479.43);             
insert into video_category_by_qtr values('11-95','East','PA','Pittsburgh','Thriller',863.47,292.8,570.68);            
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Action',620.95,212,408.95);                   
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Childrens',489.51,172.67,316.84);             
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Comedy',385.49,138.77,246.72);                
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Drama',292.99,122.2,170.78);                  
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Horror',213.2,76.57,136.63);                  
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Romantic Comedy',689.86,231.85,458.01);       
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Sci-Fi',210.34,86.66,123.67);                 
insert into video_category_by_qtr values('11-95','West','AZ','Phoenix','Thriller',566.46,198.24,368.22);              
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Action',913.1,227.2,685.91);              
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Childrens',40.7,13.43,27.27);             
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Comedy',441.07,121.42,319.65);            
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Drama',135.45,44.7,90.75);                
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Horror',134.26,41.54,92.72);              
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Romantic Comedy',208.14,63.95,144.2);     
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Sci-Fi',91.46,29,62.46);                  
insert into video_category_by_qtr values('11-95','West','CA','Los Angeles','Thriller',715.49,184.77,530.72);          
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Action',2747.34,853.5,1893.84);         
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Childrens',1318.55,439.46,879.09);      
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Comedy',2701.42,855.09,1846.33);        
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Drama',1794.3,629.76,1164.54);          
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Horror',1250.61,418.74,831.87);         
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Romantic Comedy',3442.35,1061.43,2380.92 );                                                                                                  
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Sci-Fi',860.66,296.94,563.72);          
insert into video_category_by_qtr values('11-95','West','CA','San Francisco','Thriller',2944.63,913.51,2031.12);      
insert into video_category_by_qtr values('11-95','West','CO','Denver','Action',1999.35,613.6,1385.75);                
insert into video_category_by_qtr values('11-95','West','CO','Denver','Childrens',1481.33,462.35,1018.98);            
insert into video_category_by_qtr values('11-95','West','CO','Denver','Comedy',1063.74,328.11,735.63);                
insert into video_category_by_qtr values('11-95','West','CO','Denver','Drama',740.86,285.79,455.07);                  
insert into video_category_by_qtr values('11-95','West','CO','Denver','Horror',473.44,149.42,324.01);                 
insert into video_category_by_qtr values('11-95','West','CO','Denver','Romantic Comedy',1686.83,522.17,1164.66);      
insert into video_category_by_qtr values('11-95','West','CO','Denver','Sci-Fi',1022.58,322.05,700.53);                
insert into video_category_by_qtr values('11-95','West','CO','Denver','Thriller',667.84,229.98,437.86);               
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Action',3184.94,969.02,2215.92);              
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Childrens',1163.47,395.02,768.45);            
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Comedy',2612.69,830.95,1781.74);              
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Drama',1516.06,546.61,969.45);                
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Horror',1405.93,455.83,950.09);               
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Romantic Comedy',3153.31,988.04,2165.28);     
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Sci-Fi',1288.66,419.47,869.19);               
insert into video_category_by_qtr values('11-95','West','WA','Seattle','Thriller',1889.81,639.16,1250.65);            
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Action',809.34,254.66,554.68);             
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Childrens',279.52,90.22,189.3);            
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Comedy',405.12,135.44,269.68);             
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Drama',173.45,69.38,104.07);               
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Horror',243.89,82.56,161.33);              
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Romantic Comedy',910.68,282.24,628.44);    
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Sci-Fi',940.62,277.86,662.76);             
insert into video_category_by_qtr values('22-95','Central','IL','Chicago','Thriller',898.19,277,621.19);              
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Action',2434.25,881.52,1552.73);        
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Childrens',1556.58,590.79,965.79);      
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Comedy',2851.05,1029.33,1821.72);       
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Drama',1432,613.67,818.34);             
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Horror',745.25,303.56,441.69);          
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Romantic Comedy',2027.22,786.17,1241.05);                                                                                                   
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Sci-Fi',988.13,384.78,603.35);          
insert into video_category_by_qtr values('22-95','Central','KY','Louisville','Thriller',2974.01,1085.23,1888.78);     
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Action',1515.48,449.1,1066.37);        
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Childrens',131.05,52.42,78.63);        
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Comedy',935.3,306.36,628.94);          
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Drama',265.04,102.5,162.54);           
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Horror',225.39,76.76,148.64);          
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Romantic Comedy',970.68,297.9,672.79); 
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Sci-Fi',255.37,80.56,174.81);          
insert into video_category_by_qtr values('22-95','Central','MN','Minneapolis','Thriller',492.44,166.48,325.96);       
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Action',1361.73,405.5,956.23);           
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Childrens',608.37,212.17,396.2);         
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Comedy',1326.63,418.88,907.75);          
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Drama',745.59,275.69,469.9);             
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Horror',420.09,141.43,278.66);           
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Romantic Comedy',826.93,276.86,550.07);  
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Sci-Fi',385.41,147.02,238.38);           
insert into video_category_by_qtr values('22-95','Central','MO','St. Louis','Thriller',1716.43,550.75,1165.68);       
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Action',3445.68,1327.54,2118.15);       
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Childrens',1692.96,695.97,996.99);      
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Comedy',2040.09,853.22,1186.87);        
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Drama',1817.61,823.45,994.16);          
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Horror',1319.86,551.4,768.46);          
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Romantic Comedy',1660.42,694.24,966.18);
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Sci-Fi',1715.04,716.04,999);            
insert into video_category_by_qtr values('22-95','Central','OH','Cincinnati','Thriller',2599.24,1059.08,1540.16);     
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Action',265.31,77.5,187.81);             
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Childrens',386.15,130.79,255.36);        
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Comedy',645.6,187.89,457.71);            
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Drama',348.35,132.37,215.98);            
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Horror',208.99,73.52,135.47);            
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Romantic Comedy',325.9,107.89,218.01);   
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Sci-Fi',415.03,130.37,284.66);           
insert into video_category_by_qtr values('22-95','Central','TN','Nashville','Thriller',1392.55,409.35,983.2);         
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Action',922.39,287.56,634.83);              
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Childrens',122.84,46.74,76.1);              
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Comedy',403.12,145.82,257.3);               
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Drama',433.54,159.34,274.2);                
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Horror',377.48,123.16,254.31);              
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Romantic Comedy',533.99,162.1,371.88);      
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Sci-Fi',230.24,83.68,146.56);               
insert into video_category_by_qtr values('22-95','Central','TX','Dallas','Thriller',609.73,205.92,403.81);            
insert into video_category_by_qtr values('22-95','East','DC','Washington','Action',3663.04,1680.94,1982.1);           
insert into video_category_by_qtr values('22-95','East','DC','Washington','Childrens',1032.01,504.31,527.71);         
insert into video_category_by_qtr values('22-95','East','DC','Washington','Comedy',2553.56,1206.6,1346.96);           
insert into video_category_by_qtr values('22-95','East','DC','Washington','Drama',1787.77,990.63,797.14);             
insert into video_category_by_qtr values('22-95','East','DC','Washington','Horror',1698.99,813.16,885.83);            
insert into video_category_by_qtr values('22-95','East','DC','Washington','Romantic Comedy',1953.6,970.22,983.39);    
insert into video_category_by_qtr values('22-95','East','DC','Washington','Sci-Fi',1077.47,553.6,523.88);             
insert into video_category_by_qtr values('22-95','East','DC','Washington','Thriller',1956.42,970.24,986.19);          
insert into video_category_by_qtr values('22-95','East','FL','Miami','Action',1122.39,445.97,676.42);                 
insert into video_category_by_qtr values('22-95','East','FL','Miami','Childrens',45.85,23.84,22.01);                  
insert into video_category_by_qtr values('22-95','East','FL','Miami','Comedy',393.77,178.9,214.87);                   
insert into video_category_by_qtr values('22-95','East','FL','Miami','Drama',231.75,120.51,111.24);                   
insert into video_category_by_qtr values('22-95','East','FL','Miami','Horror',534.54,219.4,315.14);                   
insert into video_category_by_qtr values('22-95','East','FL','Miami','Romantic Comedy',430.43,174.79,255.64);         
insert into video_category_by_qtr values('22-95','East','FL','Miami','Sci-Fi',260.9,112.39,148.51);                   
insert into video_category_by_qtr values('22-95','East','FL','Miami','Thriller',518.99,227.03,291.96);                
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Action',849.53,527.6,321.93);                 
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Childrens',551.89,361.14,190.75);             
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Comedy',981.26,578.66,402.6);                 
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Drama',481.9,361.43,120.48);                  
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Horror',675.26,391.82,283.44);                
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Romantic Comedy',939.4,574.38,365.02);        
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Sci-Fi',666.36,417.23,249.13);                
insert into video_category_by_qtr values('22-95','East','GA','Atlanta','Thriller',1357.16,823.81,533.36);             
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Action',888.21,188.09,700.12);            
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Childrens',499.65,115.61,384.04);         
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Comedy',796.76,169.01,627.75);            
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Drama',390.2,109.26,280.94);              
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Horror',417.68,94.6,323.08);              
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Romantic Comedy',269.02,73.51,195.5);     
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Sci-Fi',130.81,31.59,99.22);              
insert into video_category_by_qtr values('22-95','East','LA','New Orleans','Thriller',610.74,132.62,478.12);          
insert into video_category_by_qtr values('22-95','East','MA','Boston','Action',1308.95,407.22,901.73);                
insert into video_category_by_qtr values('22-95','East','MA','Boston','Childrens',501.17,160.33,340.84);              
insert into video_category_by_qtr values('22-95','East','MA','Boston','Comedy',955.27,328.55,626.72);                 
insert into video_category_by_qtr values('22-95','East','MA','Boston','Drama',370,148,222);                           
insert into video_category_by_qtr values('22-95','East','MA','Boston','Horror',602.01,200.93,401.08);                 
insert into video_category_by_qtr values('22-95','East','MA','Boston','Romantic Comedy',716.16,237.81,478.35);        
insert into video_category_by_qtr values('22-95','East','MA','Boston','Sci-Fi',886.59,281.72,604.87);                 
insert into video_category_by_qtr values('22-95','East','MA','Boston','Thriller',1222.03,389.54,832.49);              
insert into video_category_by_qtr values('22-95','East','NY','New York','Action',5164.54,1638.72,3525.83);            
insert into video_category_by_qtr values('22-95','East','NY','New York','Childrens',3908.2,1252.26,2655.94);          
insert into video_category_by_qtr values('22-95','East','NY','New York','Comedy',5702.63,1805.93,3896.7);             
insert into video_category_by_qtr values('22-95','East','NY','New York','Drama',4099.67,1475.96,2623.71);             
insert into video_category_by_qtr values('22-95','East','NY','New York','Horror',2585.03,840.8,1744.22);              
insert into video_category_by_qtr values('22-95','East','NY','New York','Romantic Comedy',4120.52,1361.94,2758.58);   
insert into video_category_by_qtr values('22-95','East','NY','New York','Sci-Fi',2524.73,871.49,1653.24);             
insert into video_category_by_qtr values('22-95','East','NY','New York','Thriller',3775.31,1280.14,2495.18);          
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Action',924.15,223.66,700.5);            
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Childrens',488.45,126.75,361.7);         
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Comedy',1282.2,313.66,968.54);           
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Drama',1256.83,323.08,933.75);           
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Horror',824.8,193.44,631.36);            
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Romantic Comedy',1666.4,390.48,1275.92); 
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Sci-Fi',635.82,176.82,459.01);           
insert into video_category_by_qtr values('22-95','East','PA','Philadelphia','Thriller',1767.09,415.96,1351.13);       
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Action',1544.84,485.68,1059.16);           
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Childrens',824.72,270.72,554);             
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Comedy',650.39,220.82,429.57);             
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Drama',1026.97,379.61,647.36);             
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Horror',779.98,252.97,527.01);             
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Romantic Comedy',692.73,237.65,455.07);    
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Sci-Fi',302.66,110.51,192.15);             
insert into video_category_by_qtr values('22-95','East','PA','Pittsburgh','Thriller',1378.46,440.69,937.77);          
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Action',363.09,128.43,234.66);                
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Childrens',349.48,119.34,230.14);             
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Comedy',597.27,205.26,392.01);                
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Drama',164.49,68.15,96.34);                   
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Horror',411.67,152.1,259.57);                 
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Romantic Comedy',692.19,227.09,465.1);        
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Sci-Fi',218.86,92.44,126.42);                 
insert into video_category_by_qtr values('22-95','West','AZ','Phoenix','Thriller',544.03,186.28,357.75);              
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Action',545.24,137.45,407.79);            
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Childrens',511.08,136.07,375);            
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Comedy',463.26,123.85,339.41);            
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Drama',731.59,206.2,525.39);              
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Horror',228.23,64.22,164.01);             
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Romantic Comedy',483.15,124.82,358.33);   
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Sci-Fi',272.14,74.57,197.57);             
insert into video_category_by_qtr values('22-95','West','CA','Los Angeles','Thriller',1132.49,287.09,845.4);          
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Action',2479.65,777.04,1702.61);        
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Childrens',817.91,286.39,531.52);       
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Comedy',2830.27,877.58,1952.69);        
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Drama',1439.79,547.77,892.02);          
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Horror',1293.76,438.04,855.73);         
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Romantic Comedy',3268.1,1012,2256.1);   
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Sci-Fi',908.06,314.67,593.39);          
insert into video_category_by_qtr values('22-95','West','CA','San Francisco','Thriller',3364.92,1073.96,2290.96);     
insert into video_category_by_qtr values('22-95','West','CO','Denver','Action',1613.39,487.31,1126.08);               
insert into video_category_by_qtr values('22-95','West','CO','Denver','Childrens',1205.07,372.97,832.1);              
insert into video_category_by_qtr values('22-95','West','CO','Denver','Comedy',356.31,141.49,214.82);                 
insert into video_category_by_qtr values('22-95','West','CO','Denver','Drama',1131.6,408.98,722.62);                  
insert into video_category_by_qtr values('22-95','West','CO','Denver','Horror',670.36,214.09,456.27);                 
insert into video_category_by_qtr values('22-95','West','CO','Denver','Romantic Comedy',801.12,262.46,538.66);        
insert into video_category_by_qtr values('22-95','West','CO','Denver','Sci-Fi',537.61,181,356.6);                     
insert into video_category_by_qtr values('22-95','West','CO','Denver','Thriller',1736.19,548.26,1187.93);             
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Action',1631.4,515.37,1116.03);               
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Childrens',1966.86,614.84,1352.02);           
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Comedy',2078.65,684.26,1394.4);               
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Drama',1291.49,490.69,800.8);                 
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Horror',1461.26,490.06,971.2);                
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Romantic Comedy',2379.46,758.49,1620.97);     
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Sci-Fi',1726.35,544.58,1181.77);              
insert into video_category_by_qtr values('22-95','West','WA','Seattle','Thriller',3058.5,973.63,2084.88);             
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Action',145.55,58.22,87.33);               
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Childrens',535.62,172.67,362.95);          
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Comedy',322.92,114.78,208.14);             
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Drama',315.78,114.32,201.46);              
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Horror',324.05,111.92,212.14);             
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Romantic Comedy',741.89,237.21,504.68);    
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Sci-Fi',129.9,51.96,77.94);                
insert into video_category_by_qtr values('33-95','Central','IL','Chicago','Thriller',598.56,199.26,399.3);            
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Action',1955.4,702.88,1252.52);         
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Childrens',1450.97,581.02,869.96);      
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Comedy',1657.57,633.96,1023.61);        
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Drama',1389.09,627.22,761.87);          
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Horror',1119.98,432.43,687.56);         
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Romantic Comedy',2677.09,975.32,1701.78);                                                                                                   
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Sci-Fi',1055.01,432.37,622.64);         
insert into video_category_by_qtr values('33-95','Central','KY','Louisville','Thriller',2254.72,892.79,1361.93);      
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Action',1262.04,398.12,863.92);        
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Childrens',81.75,32.7,49.05);          
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Comedy',457.67,151.89,305.78);         
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Drama',454.65,181.86,272.79);          
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Horror',205.78,68.35,137.43);          
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Romantic Comedy',598.48,207.83,390.65);
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Sci-Fi',491.49,156.66,334.83);         
insert into video_category_by_qtr values('33-95','Central','MN','Minneapolis','Thriller',657.69,212.76,444.93);       
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Action',1223.95,382.76,841.2);           
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Childrens',695.29,231.74,463.55);        
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Comedy',1110.58,374.72,735.86);          
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Drama',850.42,325.78,524.64);            
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Horror',859.76,286.09,573.67);           
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Romantic Comedy',1379.15,449.69,929.45); 
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Sci-Fi',879.42,290.49,588.93);           
insert into video_category_by_qtr values('33-95','Central','MO','St. Louis','Thriller',1292.13,422.36,869.78);        
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Action',2135.05,873.36,1261.69);        
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Childrens',1729.83,731,998.83);         
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Comedy',1718.48,684.21,1034.27);        
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Drama',1223.29,610.05,613.24);          
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Horror',1199.52,503.3,696.22);          
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Romantic Comedy',2501.15,1008.23,1492.92 );                                                                                                  
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Sci-Fi',1380.76,578.8,801.96);          
insert into video_category_by_qtr values('33-95','Central','OH','Cincinnati','Thriller',2556.84,1065.07,1491.77);     
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Action',357.37,114.9,242.48);            
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Childrens',364.25,117.15,247.11);        
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Comedy',234.85,84.51,150.34);            
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Drama',140.35,53.33,87.02);              
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Horror',231.48,75.3,156.17);             
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Romantic Comedy',488.9,157.68,331.22);   
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Sci-Fi',503.97,164.92,339.05);           
insert into video_category_by_qtr values('33-95','Central','TN','Nashville','Thriller',245.03,86.85,158.18);          
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Action',381.09,128.88,252.21);              
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Childrens',861.95,261.63,600.32);           
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Comedy',643.9,204.93,438.97);               
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Drama',269.4,107.76,161.64);                
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Horror',233.37,83.25,150.12);               
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Romantic Comedy',644.02,215.57,428.45);     
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Sci-Fi',153.51,60.88,92.63);                
insert into video_category_by_qtr values('33-95','Central','TX','Dallas','Thriller',450.31,158.13,292.18);            
insert into video_category_by_qtr values('33-95','East','DC','Washington','Action',2096.88,987.74,1109.14);           
insert into video_category_by_qtr values('33-95','East','DC','Washington','Childrens',1947.36,926.16,1021.2);         
insert into video_category_by_qtr values('33-95','East','DC','Washington','Comedy',1858.18,905.56,952.62);            
insert into video_category_by_qtr values('33-95','East','DC','Washington','Drama',1295.24,746.7,548.54);              
insert into video_category_by_qtr values('33-95','East','DC','Washington','Horror',832.02,441.73,390.29);             
insert into video_category_by_qtr values('33-95','East','DC','Washington','Romantic Comedy',2194.32,1083.03,1111.29); 
insert into video_category_by_qtr values('33-95','East','DC','Washington','Sci-Fi',1785.37,887.8,897.58);             
insert into video_category_by_qtr values('33-95','East','DC','Washington','Thriller',1739.1,891.22,847.88);           
insert into video_category_by_qtr values('33-95','East','FL','Miami','Action',467.83,206.43,261.4);                   
insert into video_category_by_qtr values('33-95','East','FL','Miami','Childrens',82.2,42.74,39.46);                   
insert into video_category_by_qtr values('33-95','East','FL','Miami','Comedy',525.14,219.04,306.1);                   
insert into video_category_by_qtr values('33-95','East','FL','Miami','Drama',316.94,151.51,165.43);                   
insert into video_category_by_qtr values('33-95','East','FL','Miami','Horror',251.97,118.86,133.11);                  
insert into video_category_by_qtr values('33-95','East','FL','Miami','Romantic Comedy',359.1,158.67,200.43);          
insert into video_category_by_qtr values('33-95','East','FL','Miami','Sci-Fi',905.77,355.61,550.15);                  
insert into video_category_by_qtr values('33-95','East','FL','Miami','Thriller',805.09,337.02,468.06);                
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Action',1007.36,616.98,390.38);               
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Childrens',954.49,565.96,388.54);             
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Comedy',848.8,508.31,340.49);                 
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Drama',718.04,534.03,184.01);                 
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Horror',426.59,273.2,153.38);                 
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Romantic Comedy',1000.43,594.26,406.17);      
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Sci-Fi',621.42,402.89,218.52);                
insert into video_category_by_qtr values('33-95','East','GA','Atlanta','Thriller',1435.28,868.55,566.73);             
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Action',229.87,55.54,174.32);             
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Childrens',150.2,42.06,108.14);           
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Comedy',706.91,153.61,553.3);             
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Drama',388,108.64,279.36);                
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Horror',442.01,102.13,339.88);            
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Romantic Comedy',450.88,103.3,347.58);    
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Sci-Fi',324.87,75.85,249.02);             
insert into video_category_by_qtr values('33-95','East','LA','New Orleans','Thriller',411.96,98.46,313.49);           
insert into video_category_by_qtr values('33-95','East','MA','Boston','Action',762.83,254.98,507.85);                 
insert into video_category_by_qtr values('33-95','East','MA','Boston','Childrens',863.66,283.1,580.56);               
insert into video_category_by_qtr values('33-95','East','MA','Boston','Comedy',1217,389.96,827.04);                   
insert into video_category_by_qtr values('33-95','East','MA','Boston','Drama',697.03,272.42,424.61);                  
insert into video_category_by_qtr values('33-95','East','MA','Boston','Horror',656.82,220.66,436.16);                 
insert into video_category_by_qtr values('33-95','East','MA','Boston','Romantic Comedy',1705.53,522,1183.53);         
insert into video_category_by_qtr values('33-95','East','MA','Boston','Sci-Fi',1315.66,414.32,901.34);                
insert into video_category_by_qtr values('33-95','East','MA','Boston','Thriller',1054.2,352.92,701.28);               
insert into video_category_by_qtr values('33-95','East','NY','New York','Action',5169.24,1646.35,3522.88);            
insert into video_category_by_qtr values('33-95','East','NY','New York','Childrens',3230.35,1085.06,2145.29);         
insert into video_category_by_qtr values('33-95','East','NY','New York','Comedy',3146.03,1071.56,2074.47);            
insert into video_category_by_qtr values('33-95','East','NY','New York','Drama',3196.45,1203.45,1993);                
insert into video_category_by_qtr values('33-95','East','NY','New York','Horror',3236.65,1051.15,2185.5);             
insert into video_category_by_qtr values('33-95','East','NY','New York','Romantic Comedy',4728.35,1546.11,3182.24);   
insert into video_category_by_qtr values('33-95','East','NY','New York','Sci-Fi',2548.55,877.37,1671.18);             
insert into video_category_by_qtr values('33-95','East','NY','New York','Thriller',4046.45,1391.08,2655.37);          
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Action',605.33,148.62,456.71);           
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Childrens',888.71,216.24,672.47);        
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Comedy',1044.04,266.03,778.02);          
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Drama',993.04,296.95,696.08);            
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Horror',643.39,166.11,477.28);           
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Romantic Comedy',1464.38,333.35,1131.03);
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Sci-Fi',1596.44,370.04,1226.4);          
insert into video_category_by_qtr values('33-95','East','PA','Philadelphia','Thriller',1126.78,297.42,829.36);        
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Action',1002.58,319.61,682.96);            
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Childrens',1212.66,373.13,839.53);         
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Comedy',485.7,180.68,305.02);              
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Drama',496.55,198.62,297.93);              
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Horror',469.29,159.51,309.78);             
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Romantic Comedy',1110.33,374.85,735.48);   
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Sci-Fi',1254.82,400.38,854.44);            
insert into video_category_by_qtr values('33-95','East','PA','Pittsburgh','Thriller',717.51,255.74,461.77);           
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Action',478.85,161.31,317.54);                
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Childrens',518.65,185.2,333.45);              
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Comedy',562.46,196.14,366.32);                
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Drama',411.95,177.14,234.81);                 
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Horror',177.12,64.04,113.08);                 
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Romantic Comedy',270.75,115.87,154.89);       
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Sci-Fi',397.61,145.19,252.42);                
insert into video_category_by_qtr values('33-95','West','AZ','Phoenix','Thriller',556.39,204.13,352.26);              
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Action',411.27,115.52,295.74);            
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Childrens',313.12,79.58,233.54);          
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Comedy',935.62,247.84,687.78);            
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Drama',355.4,117.28,238.12);              
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Horror',277.58,76.62,200.96);             
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Romantic Comedy',605.26,157.1,448.16);    
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Sci-Fi',275.94,75.23,200.71);             
insert into video_category_by_qtr values('33-95','West','CA','Los Angeles','Thriller',432.59,116.76,315.83);          
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Action',1389.78,467.47,922.32);         
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Childrens',1597.85,549.59,1048.26);     
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Comedy',1896.93,626.1,1270.83);         
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Drama',1642.51,634.14,1008.37);         
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Horror',1206.67,401.87,804.79);         
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Romantic Comedy',2354.01,756.2,1597.82);
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Sci-Fi',1236.25,417.22,819.03);         
insert into video_category_by_qtr values('33-95','West','CA','San Francisco','Thriller',1884.35,629.39,1254.96);      
insert into video_category_by_qtr values('33-95','West','CO','Denver','Action',773.06,251.92,521.14);                 
insert into video_category_by_qtr values('33-95','West','CO','Denver','Childrens',634.02,212.83,421.19);              
insert into video_category_by_qtr values('33-95','West','CO','Denver','Comedy',640.8,226.13,414.67);                  
insert into video_category_by_qtr values('33-95','West','CO','Denver','Drama',477.6,191.04,286.56);                   
insert into video_category_by_qtr values('33-95','West','CO','Denver','Horror',578.8,209.81,368.98);                  
insert into video_category_by_qtr values('33-95','West','CO','Denver','Romantic Comedy',550.93,191.17,359.76);        
insert into video_category_by_qtr values('33-95','West','CO','Denver','Sci-Fi',675.97,220.98,454.99);                 
insert into video_category_by_qtr values('33-95','West','CO','Denver','Thriller',1014.29,339.16,675.13);              
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Action',2019.65,648.51,1371.13);              
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Childrens',1572.31,493,1079.31);              
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Comedy',2677.61,859.4,1818.21);               
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Drama',1827.06,646.88,1180.18);               
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Horror',975.73,343.72,632.01);                
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Romantic Comedy',2335.72,764.24,1571.48);     
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Sci-Fi',1516.49,507.22,1009.27);              
insert into video_category_by_qtr values('33-95','West','WA','Seattle','Thriller',1819.53,608.34,1211.19);            
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Action',909.47,276.95,632.52);             
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Childrens',363.27,121.32,241.95);          
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Comedy',1070.25,351.34,718.91);            
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Drama',556.6,194.65,361.95);               
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Horror',1037.8,306.2,731.59);              
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Romantic Comedy',696.22,213.89,482.33);    
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Sci-Fi',123.5,49.4,74.1);                  
insert into video_category_by_qtr values('44-95','Central','IL','Chicago','Thriller',813.2,259.1,554.1);              
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Action',4716.14,1636.81,3079.32);       
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Childrens',2054.09,772,1282.1);         
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Comedy',2155.23,824.42,1330.81);        
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Drama',1533.13,682.25,850.88);          
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Horror',1131.87,426.06,705.81);         
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Romantic Comedy',2939.59,1077.82,1861.77);
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Sci-Fi',1929.15,738.46,1190.7);         
insert into video_category_by_qtr values('44-95','Central','KY','Louisville','Thriller',2798.15,1020.32,1777.82);     
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Action',320.72,121.58,199.13);         
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Childrens',910.7,270.56,640.14);       
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Comedy',902.34,278.73,623.61);         
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Drama',545.92,186.7,359.22);           
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Horror',900.42,270.48,629.94);         
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Romantic Comedy',896.19,274.03,622.16);
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Sci-Fi',407.97,142.1,265.87);          
insert into video_category_by_qtr values('44-95','Central','MN','Minneapolis','Thriller',917.36,297.53,619.83);       
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Action',3266.39,967.68,2298.7);          
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Childrens',842.08,264.7,577.38);         
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Comedy',701.97,251.2,450.77);            
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Drama',1247.24,438.92,808.32);           
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Horror',921.87,303.39,618.48);           
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Romantic Comedy',1861.93,600.04,1261.89);
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Sci-Fi',570.54,210.31,360.23);           
insert into video_category_by_qtr values('44-95','Central','MO','St. Louis','Thriller',2459.68,741.89,1717.79);       
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Action',4619.21,1737.27,2881.94);       
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Childrens',1779.45,734.59,1044.86);     
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Comedy',4940.42,1927.86,3012.56);       
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Drama',1628.37,787.2,841.17);           
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Horror',1861.98,753.79,1108.19);        
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Romantic Comedy',2903.2,1162.2,1741);   
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Sci-Fi',2584.87,1030.55,1554.32);       
insert into video_category_by_qtr values('44-95','Central','OH','Cincinnati','Thriller',4266.57,1666.24,2600.33);     
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Action',428.53,123.97,304.55);           
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Childrens',1593.51,449.19,1144.32);      
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Comedy',435.06,129.16,305.9);            
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Drama',278.15,105.7,172.45);             
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Horror',279.79,82.78,197);               
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Romantic Comedy',596.38,177.86,418.52);  
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Sci-Fi',376.4,116.6,259.8);              
insert into video_category_by_qtr values('44-95','Central','TN','Nashville','Thriller',548.03,171.62,376.4);          
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Action',1025.94,316.52,709.42);             
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Childrens',133.1,53.24,79.86);              
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Comedy',312.14,104.55,207.59);              
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Drama',396.23,138.5,257.73);                
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Horror',358.1,113.18,244.92);               
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Romantic Comedy',502.06,171.26,330.8);      
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Sci-Fi',1037.45,318.54,718.91);             
insert into video_category_by_qtr values('44-95','Central','TX','Dallas','Thriller',856.38,270.95,585.43);            
insert into video_category_by_qtr values('44-95','East','DC','Washington','Action',2756.53,1304.71,1451.82);          
insert into video_category_by_qtr values('44-95','East','DC','Washington','Childrens',1414.13,737.41,676.73);         
insert into video_category_by_qtr values('44-95','East','DC','Washington','Comedy',3057.48,1457.86,1599.62);          
insert into video_category_by_qtr values('44-95','East','DC','Washington','Drama',1739.79,995.89,743.9);              
insert into video_category_by_qtr values('44-95','East','DC','Washington','Horror',1445.37,699.7,745.67);             
insert into video_category_by_qtr values('44-95','East','DC','Washington','Romantic Comedy',3631.19,1725.56,1905.63); 
insert into video_category_by_qtr values('44-95','East','DC','Washington','Sci-Fi',1381.4,703.17,678.23);             
insert into video_category_by_qtr values('44-95','East','DC','Washington','Thriller',3894.51,1850.93,2043.58);        
insert into video_category_by_qtr values('44-95','East','FL','Miami','Action',1125.66,435.24,690.42);                 
insert into video_category_by_qtr values('44-95','East','FL','Miami','Childrens',450.26,182.78,267.48);               
insert into video_category_by_qtr values('44-95','East','FL','Miami','Comedy',727.2,300.39,426.81);                   
insert into video_category_by_qtr values('44-95','East','FL','Miami','Drama',303.85,158,145.85);                      
insert into video_category_by_qtr values('44-95','East','FL','Miami','Horror',220,95.1,124.89);                       
insert into video_category_by_qtr values('44-95','East','FL','Miami','Romantic Comedy',595.97,269.6,326.36);          
insert into video_category_by_qtr values('44-95','East','FL','Miami','Sci-Fi',478.35,205.29,273.06);                  
insert into video_category_by_qtr values('44-95','East','FL','Miami','Thriller',278.38,126.23,152.15);                
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Action',2625.53,1464.8,1160.72);              
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Childrens',871.91,531.89,340.03);             
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Comedy',2078.4,1185.8,892.6);                 
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Drama',969.57,659.71,309.87);                 
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Horror',744.42,460.41,284.01);                
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Romantic Comedy',2280.29,1332.71,947.59);     
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Sci-Fi',467.97,305.99,161.97);                
insert into video_category_by_qtr values('44-95','East','GA','Atlanta','Thriller',1490.04,908.93,581.11);             
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Action',1243.19,266.71,976.47);           
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Childrens',1006.61,203.48,803.13);        
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Comedy',1035.02,226.22,808.8);            
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Drama',445.69,122.33,323.36);             
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Horror',743.34,168.99,574.35);            
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Romantic Comedy',597.84,141.2,456.64);    
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Sci-Fi',386.91,102.4,284.51);             
insert into video_category_by_qtr values('44-95','East','LA','New Orleans','Thriller',588.54,132.87,455.68);          
insert into video_category_by_qtr values('44-95','East','MA','Boston','Action',1257.44,388.64,868.8);                 
insert into video_category_by_qtr values('44-95','East','MA','Boston','Childrens',661.4,221.06,440.34);               
insert into video_category_by_qtr values('44-95','East','MA','Boston','Comedy',1537.03,474.87,1062.16);               
insert into video_category_by_qtr values('44-95','East','MA','Boston','Drama',800.31,280.14,520.17);                  
insert into video_category_by_qtr values('44-95','East','MA','Boston','Horror',566.46,194.32,372.15);                 
insert into video_category_by_qtr values('44-95','East','MA','Boston','Romantic Comedy',1708.61,531.55,1177.06);      
insert into video_category_by_qtr values('44-95','East','MA','Boston','Sci-Fi',1253.98,388.68,865.3);                 
insert into video_category_by_qtr values('44-95','East','MA','Boston','Thriller',2737.45,842.38,1895.06);             
insert into video_category_by_qtr values('44-95','East','NY','New York','Action',10054.62,3016.92,7037.69);           
insert into video_category_by_qtr values('44-95','East','NY','New York','Childrens',4572.26,1454.18,3118.08);         
insert into video_category_by_qtr values('44-95','East','NY','New York','Comedy',5961.47,1905,4056.47);               
insert into video_category_by_qtr values('44-95','East','NY','New York','Drama',3807.28,1466.62,2340.66);             
insert into video_category_by_qtr values('44-95','East','NY','New York','Horror',4014.66,1302.25,2712.41);            
insert into video_category_by_qtr values('44-95','East','NY','New York','Romantic Comedy',4986.63,1603.67,3382.97);   
insert into video_category_by_qtr values('44-95','East','NY','New York','Sci-Fi',3929.65,1258.57,2671.08);            
insert into video_category_by_qtr values('44-95','East','NY','New York','Thriller',9070.61,2817.27,6253.34);          
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Action',1585.66,372.2,1213.46);          
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Childrens',2061.61,474.78,1586.83);      
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Comedy',1610.89,376.28,1234.61);         
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Drama',1703.63,426.89,1276.75);          
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Horror',861.88,228.74,633.14);           
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Romantic Comedy',2751.17,630.44,2120.73);
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Sci-Fi',897.85,230.86,666.99);           
insert into video_category_by_qtr values('44-95','East','PA','Philadelphia','Thriller',2716.48,657.76,2058.72);       
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Action',2803.49,831.32,1972.17);           
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Childrens',824.68,266.38,558.3);           
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Comedy',1528.75,490.45,1038.3);            
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Drama',633.05,253.22,379.83);              
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Horror',892.69,280.69,611.99);             
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Romantic Comedy',1691.01,538.9,1152.11);   
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Sci-Fi',1617.9,493.15,1124.75);            
insert into video_category_by_qtr values('44-95','East','PA','Pittsburgh','Thriller',2214.04,677.28,1536.75);         
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Action',389.69,136.28,253.41);                
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Childrens',47.25,20.32,26.93);                
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Comedy',992.25,328.15,664.1);                 
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Drama',284.7,122.42,162.28);                  
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Horror',307.08,113.52,193.57);                
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Romantic Comedy',461.44,162.86,298.58);       
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Sci-Fi',385.72,138.19,247.53);                
insert into video_category_by_qtr values('44-95','West','AZ','Phoenix','Thriller',1485.11,488.16,996.95);             
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Action',289.68,78.84,210.83);             
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Childrens',137.35,45.33,92.02);           
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Comedy',287.5,84.58,202.91);              
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Drama',299.85,98.95,200.9);               
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Horror',157.29,45.59,111.71);             
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Romantic Comedy',608.61,156.52,452.09);   
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Sci-Fi',626.31,165.8,460.51);             
insert into video_category_by_qtr values('44-95','West','CA','Los Angeles','Thriller',330.45,97.69,232.76);           
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Action',2670.13,829.31,1840.82);        
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Childrens',2080.31,666.92,1413.39);     
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Comedy',5658.51,1722.41,3936.1);        
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Drama',3593.06,1178.45,2414.61);        
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Horror',2544.65,803.36,1741.29);        
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Romantic Comedy',1508.35,555.54,952.82);
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Sci-Fi',853.89,317.57,536.32);          
insert into video_category_by_qtr values('44-95','West','CA','San Francisco','Thriller',2187.32,762.74,1424.58);      
insert into video_category_by_qtr values('44-95','West','CO','Denver','Action',1224.57,397.24,827.33);                
insert into video_category_by_qtr values('44-95','West','CO','Denver','Childrens',1605.93,498.75,1107.18);            
insert into video_category_by_qtr values('44-95','West','CO','Denver','Comedy',1662.17,527.99,1134.18);               
insert into video_category_by_qtr values('44-95','West','CO','Denver','Drama',626.8,250.72,376.08);                   
insert into video_category_by_qtr values('44-95','West','CO','Denver','Horror',497.78,176.92,320.86);                 
insert into video_category_by_qtr values('44-95','West','CO','Denver','Romantic Comedy',1112.19,363,749.19);          
insert into video_category_by_qtr values('44-95','West','CO','Denver','Sci-Fi',1887.89,584.05,1303.84);               
insert into video_category_by_qtr values('44-95','West','CO','Denver','Thriller',1811.05,584.39,1226.66);             
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Action',2334.05,755.07,1578.98);              
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Childrens',2564.36,814.31,1750.05);           
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Comedy',2028.17,669.9,1358.27);               
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Drama',1975.46,725.57,1249.89);               
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Horror',1465.82,491.62,974.2);                
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Romantic Comedy',3214.32,993.22,2221.09);     
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Sci-Fi',1649.92,550.45,1099.47);              
insert into video_category_by_qtr values('44-95','West','WA','Seattle','Thriller',4505.19,1378.64,3126.55);           

create table news_let
(VOL                                      NUMBER(2),
 ISSUE                                    NUMBER(6),
 PAGE_NO                                  NUMBER(2),
 LANG                                     VARCHAR2(20),
 SECTION_NAME                             VARCHAR2(20),
 COL_NUM                                  NUMBER(2),
 PRINT_ORD                                NUMBER(2),
 COL_TYPE                                 VARCHAR2(20),
 JUST                                     VARCHAR2(20),
 URL                                      VARCHAR2(200),
 TEXT                                     VARCHAR2(2000));

insert into news_let values(1,0,0,'ENGLISH','VOLUME_HDR1',0,1,'HEADING3','LEFT','','The Oracle Corporation Newsletter');
insert into news_let values(1,0,0,'ENGLISH','VOLUME_HDR2',0,2,'HEADING3','RIGHT','','Volume &VOLNO Issue &ISSUE &DATE');
insert into news_let values(1,1,1,'ENGLISH','WELCOME',1,1,'HEADING2','LEFT','','Welcome!');
insert into news_let values(1,1,1,'ENGLISH','WELCOME',1,2,'TEXT1','FULL','','Welcome to the first issue of "The Oracle'||
' Speaks" - the newsletter for you, the customers of Oracle Corporation');
insert into news_let values(1,1,1,'ENGLISH','THIS_ISSUE',1,3,'HEADING2','LEFT','','In This Issue:');
insert into news_let values(1,1,1,'ENGLISH','THIS_ISSUE',1,4,'TEXT3','LEFT','',
' * Report''s New Features'||chr(10)||chr(10)||' * New Employees'||chr(10)||chr(10)||
' * Oracle Open World 1998'||chr(10)||chr(10)||' * Financial Results'||chr(10)||chr(10)||
' * How To Obtain A Subscription'||chr(10)||chr(10));
insert into news_let values(1,1,1,'ENGLISH','NEW_EMP',1,5,'HEADING1','LEFT','','New Employees');
insert into news_let values(1,1,1,'ENGLISH','NEW_EMP',1,6,'TEXT1','FULL','','If you haven''t already seen our financial'||
' report for the last quarter we have included excerpts from it in this month''s issue. As you will see from the results Oracle'||
' has had an exceptional quarter.');
insert into news_let values(1,1,1,'ENGLISH','DEV_IMG',2,1,'IMAGE','LEFT','http://www.oracle.com','newslet.gif');
insert into news_let values(1,1,1,'ENGLISH','TOP_STORY',2,2,'HEADING1','LEFT','http://www.oracle.com','Top Story');
insert into news_let values(1,1,1,'ENGLISH','TOP_STORY',2,3,'TEXT1','FULL','','Oracle is pleased to announce the immediate availability'||
' of Developer Release 6.0.  This new feature packed release includes numerous enhancements and performance improvements.  Perhaps chief'||
' among the enhancements is the ability to utilize Oracle 8 objects.  Developers can now for the first time access, through Oracle Reports,'||
' Oracle 8 objects as if they were standard relational tables. We have also listened to your needs and increased the number of output options.'||
' With the same report definition you can output to PDF (Acrobat), HTML, HTMLCSS (Cascading style sheets ) and RTF (Rich Text Format ).  We'||
' have also enhanced the layout properties and added flush text support to give the right and left aligned effect you see in this newsletter.');
insert into news_let values(1,1,1,'ENGLISH','FINANCIAL_RESULTS',3,1,'HEADING1','LEFT','','Financial Results');
insert into news_let values(1,1,1,'ENGLISH','FINANCIAL_RESULTS',3,2,'TEXT1','FULL','','Redwood Shores, Calif., September 10, 1998-Oracle'||
' Corporation today announced record first quarter results for the period ended August 31, 1998.  Revenues for the first quarter increased 28'||
' percent (33 percent in local currencies) to $1.7 billion from $1.4 billion in the same period last year.  Net income for the period increased'||
' 30 percent to $195 million, or $0.20 per share, compared to net income of $150 million, or $0.15 per share, in the same period last year,'||
' excluding one-time charges for the acquisitions of Treasury Services Corporation and Navio Communications, Inc.  Giving effect to the'||
' one-time charges, net income for the previous period was $8 million.');


REM **Create Chess demo objects

create table chess_save
(
   id           NUMBER,
   name         VARCHAR2(30),
   cur_player   VARCHAR2(1));

create table chess_save_boardstate
(
   id           NUMBER,
   board_row    NUMBER,
   c1           VARCHAR2(2),
   c2           VARCHAR2(2),
   c3           VARCHAR2(2),
   c4           VARCHAR2(2),
   c5           VARCHAR2(2),
   c6           VARCHAR2(2),
   c7           VARCHAR2(2),
   c8           VARCHAR2(2));

create table chess_save_captured
(
   id           NUMBER,
   seq          NUMBER,
   piece        VARCHAR2(2));

create table chess_save_player
(
   id           NUMBER,
   player       VARCHAR2(1));

create sequence chess_saveID
increment by 1
start with 1;

create table game_semaphore
(
   id           NUMBER,
   data         VARCHAR2(30),
   status       NUMBER);


REM **Create Grid demo objects

create table grid_labels
(  view_name     varchar2(30),
   column_name   varchar2(30),
   column_label  varchar2(60)
);

create table viewdef
(  view_no      number(9),
   view_name    varchar2(60),
   static       varchar2(1),
   active       varchar2(1),
   user_name    varchar2(30),
   order_by     number(9)
);

create table viewdefcol
(  view_no      number(9),
   column_name  varchar2(30),
   x_pos        number(9),
   col_width    number(9)
);

create view empdept as
select e.empno,
       e.ename,
       e.job,
       e.mgr,
       e.hiredate,
       e.sal,
       e.comm,
       e.deptno,
       d.dname,
       d.loc
from   emp e,
       dept d
where  e.deptno = d.deptno;

create sequence viewdef_seq
start with 100
increment by 1
nocache;

insert into grid_labels values ('EMPDEPT', 'EMPNO',    'Emp Number');
insert into grid_labels values ('EMPDEPT', 'ENAME',    'Name');
insert into grid_labels values ('EMPDEPT', 'JOB',      'Title');
insert into grid_labels values ('EMPDEPT', 'MGR',      'Manager ID');
insert into grid_labels values ('EMPDEPT', 'HIREDATE', 'Date Hired');
insert into grid_labels values ('EMPDEPT', 'SAL',      'Salary');
insert into grid_labels values ('EMPDEPT', 'COMM',     'Commission');
insert into grid_labels values ('EMPDEPT', 'DEPTNO',   'Dept Number');
insert into grid_labels values ('EMPDEPT', 'DNAME',    'Department');
insert into grid_labels values ('EMPDEPT', 'LOC',      'Location');

insert into viewdef values (1, 'Standard View #1', 'Y', 'N', 'USER', 1);
insert into viewdef values (2, 'Standard View #2', 'Y', 'N', 'USER', 1);
insert into viewdef values (3, 'Mark''s View',     'N', 'Y', 'USER', 1);

insert into viewdefcol values (1, 'EMPNO',      0, 30);
insert into viewdefcol values (1, 'ENAME',     30, 30);
insert into viewdefcol values (1, 'JOB',       60, 30);
insert into viewdefcol values (1, 'DNAME',     90, 30);
insert into viewdefcol values (2, 'ENAME',      0, 30);
insert into viewdefcol values (2, 'JOB',       30, 30);
insert into viewdefcol values (2, 'MGR',       60, 30);
insert into viewdefcol values (2, 'DEPTNO',    90, 30);
insert into viewdefcol values (2, 'DNAME',    120, 30);
insert into viewdefcol values (2, 'LOC',      150, 30);
insert into viewdefcol values (3, 'EMPNO',      0, 75);
insert into viewdefcol values (3, 'ENAME',     75, 56);
insert into viewdefcol values (3, 'JOB',      131, 72);
insert into viewdefcol values (3, 'SAL',      203, 68);
insert into viewdefcol values (3, 'MGR',      271, 61);
insert into viewdefcol values (3, 'HIREDATE', 332, 66);
insert into viewdefcol values (3, 'DNAME',    398, 83);


REM **Creating DemoHelp objects
CREATE TABLE app_help(
 app_name                        VARCHAR2(5)                NOT NULL,
 app_title                       VARCHAR2(80)               NOT NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
;

CREATE TABLE forms_help(
 help_id                         NUMBER(5,0)                NOT NULL,
 app_name                        VARCHAR2(5)                NOT NULL,
 module_name                     VARCHAR2(30)               NULL,
 block_name                      VARCHAR2(30)               NULL,
 item_name                       VARCHAR2(30)               NULL,
 help_title                      VARCHAR2(80)               NULL,
 help_text                       VARCHAR2(2000)             NULL,
 father_id                       NUMBER(5,0)                NULL,
 example_text                    VARCHAR2(2000)             NULL,
 sort_id                         NUMBER(5,0)                NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
;


CREATE TABLE help_keywords(
 help_id                         NUMBER(5,0)                NOT NULL,
 app_name                        VARCHAR2(5)                NOT NULL,
 key_id                          NUMBER(5,0)                NOT NULL,
 key_name                        VARCHAR2(30)               NOT NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
;

CREATE TABLE help_related(
 help_id                         NUMBER(5,0)                NOT NULL,
 app_name                        VARCHAR2(5)                NOT NULL,
 counter                         NUMBER(5,0)                NOT NULL,
 help_id_related                 NUMBER(5,0)                NOT NULL,
 app_name_related                VARCHAR2(5)                NOT NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
;

CREATE SEQUENCE seq_help_id
 INCREMENT BY 1
 MINVALUE 50
 MAXVALUE 99999
 NOCYCLE 
 CACHE 20
 NOORDER 
;

CREATE SEQUENCE seq_des2k_app
 INCREMENT BY 1
 MINVALUE 50
 MAXVALUE 99999
 NOCYCLE 
 CACHE 20
 NOORDER 
;

 
REM POPULATE TABLES

insert into app_help (app_name,app_title) values ('HELP','Windows 95 style help system');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (22,'HELP','','','','Import Help from Designer 2000','',3,'',8);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (21,'HELP','','','','Importing help from Designer 2000','',2,'',2);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (15,'HELP','','','','Button palette','',3,'',7);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (5,'HELP','','','','Displaying On Line Help in your applications','',2,'',3);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (3,'HELP','','','','Reference','',null,'',3);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (4,'HELP','','','','Creating On Line Contents','',2,'',1);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (2,'HELP','','','','Tasks','',null,'',2);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (6,'HELP','D2KHMAIN','APP_HELP','','Application Tab','',3,'',1);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (8,'HELP','D2KHMAIN','FORMS_HELP','HELP_TEXT','Help Text Tab','',3,'',3);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (9,'HELP','D2KHMAIN','FORMS_HELP','EXAMPLE_TEXT','Examples Tab','',3,'',4);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (10,'HELP','D2KHMAIN','HELP_RELATED','','Related Tab','',3,'',5);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (11,'HELP','D2KHMAIN','HELP_KEYWORDS','','Keywords Tab','',3,'',6);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (12,'HELP','','','','Create a new application','',4,'',1);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (7,'HELP','D2KHMAIN','FORMS_HELP','','Contents Tab','',3,'',2);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (1,'HELP','D2KHMAIN','','','About the maintenance form','',null,'',1);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (13,'HELP','','','','Create topics','',4,'',2);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
insert into forms_help (help_id,app_name,module_name,block_name,item_name,help_title,help_text,father_id,example_text,sort_id) values (14,'HELP','','','','Enter help information for each topic','',4,'',3);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
update forms_help set help_text=replace('Application system#------------------------------#Display the list of the Des2000 applications you have the right to see.##Selected#--------------#This check box gives you the ability to select or not particular modules. By default all the modules are selected.##Short name#------------------#Module short name in des2000##Short title#--------------#Module short title in des2000','#',chr(10)) where help_id=22;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
update forms_help set help_text=replace('To import help from the Designer 2000 Repository, you must be a designer 2000 user and be granted (at least for select) to an application.##1. Select a Des2000 application#2. Select the modules you want to import#3. Click the Import button#The import generate the following information :##An application#     A topic for each module#            A module level help (if existing in the repository)#            A topic for each Base DTU #                    A block level help (if existing in the repository)#                    An item level help for each displayed DCU#                    (help text or hint)##It is up to you to add :##- Sequence order#- Hierarchy (with the Change parent option in the popup menu)#- Related Topics#- Keywords##You can also add or delete topics, or modify the text and the titles generated.','#',chr(10)) where help_id=21;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
update forms_help set help_text=replace('A button palette is provided for the common tasks :##Exit#Insert record#Remove record#Save#Help##The PREVIEW button enables you to see what your help system will look like while you are conctructing it.','#',chr(10)) where help_id=15;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
update forms_help set help_text=replace('Code :#--------#Identifier of the application. This code is the primary key of the APP_HELP table.###Title :#------#Application title. This title will be displayed at the top of the Winhelp window.','#',chr(10)) where help_id=6;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
update forms_help set help_text=replace('This multi-lines item enables you to enter the text which will be displayed in the help system.','#',chr(10)) where help_id=8;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
update forms_help set help_text=replace('This multi-lines item enables you to enter the example text which will be displayed in the help system.#If you enter text here, a "Example" button will be displayed to indicates to the end user that examples are availables.','#',chr(10)) where help_id=9;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
update forms_help set help_text=replace('This filed enables you to display a list of other topics in the help system which are in relation with the topics you are displaying.#Use the iconic button to display the topic list and choose the one you want to add.#You can only choose child topics.##If you enter a related topic, a button will appear in the help system to tell the end user that related topics are availables.','#',chr(10)) where help_id=10;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
update forms_help set help_text=replace('Use this functionality to add keywords to a topic. These keywords will be displayed in the index tab of the help system and makes the navigation easier for the end user.','#',chr(10)) where help_id=11;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
update forms_help set help_text=replace('To create an application, you only need to insert a new record in the application tab and  enter a code and a title for this application.##This application will be the owner of all the topics you will add to it.#','#',chr(10)) where help_id=12;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
update forms_help set help_text=replace('Level :#---------#Indicates the parent level you are in. You can choose the level you want to see as parent level with the button beside the level field.#Another iconic button allows you to go up a level (The popup menu gives you the same functionality).##Node :#---------#If it is checked, indicates that there are children under this topic.#If you press the iconic button beside the check box, you go one level down in the hierarchy (The popup menu gives you the same functionality).##Seq :#------#This field gives you the ability to sort your topics when they will be displayed in the help system. Enter a number or nothing if you do not want to sort the topics.##Help Title :#----------------#This is the title which will be displayed in the help system.##Popup Menu :#---------------------#If you click on the right mouse button in the seq or help title field, a popup menu let you go up one level, down one level, reparent a topic, or change the level displayed as a parent.##Context sensitive :#---------------------------#These fields are used to bind a topic to a particular module, block or item of your application.##','#',chr(10)) where help_id=7;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
update forms_help set help_text=replace('This Component enables you to easily add a help system to an application, to provide functionality that mimics the Windows 95 help system. It allows you to provide context sensitive help to the end users. The help text is stored in the database so that it can be easily shared among all users, making updates and changes immediately available to everybody.##In the menu action, you will find an option to import your help system from the Designer 2000 repository.#','#',chr(10)) where help_id=1;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
update forms_help set help_text=replace('In the contents tab, create help topics with a sequence number in order to sort them when they will be displayed.#Help system is hierarchical, so you can create topics which are parent of other topics.#A check box indicates if a topic is a leaf (unchecked) or a folder (checked).##Use the right mouse button or the iconic buttons to navigate between the levels :#- Go up one level#- Go down one level#- Change the level currently displayed by another that you can choose#- Reparent a topic to another parent (if you reparent a topic to a topic which contains context sensitive information, these informations will be erased after you confirm that is what you want to do).##You can enter information in the context sensitive fields in order to provide context sensitive help in your application. #For leaf nodes, the Module, Block, and Item are used to provide context sensitive help links when the help system is invoked from a form.#You can create context sensitive help topics at three levels:#- One help topic for a given item in a particular block, module, and application#- One help topic for a given block in a particular module and application#- One help topic for a given module in a particular application.##You can also create any other help topics that you require but that are not linked to a specific module, block or item. Simply use "fictitious" module, block and item names for these topics that do not clash with real modules, blocks, and items. For example, you might create help topics associated with particular windows, menus, or alerts.  These topics will also appear in the Contents and Index of your help.##','#',chr(10)) where help_id=13;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
update forms_help set help_text=replace('For each leaf topic you have created, you can add the help content:##Help text : free text to explain the topics.##Examples : free text to illustrates the topic. If example exists for the topic, a button appears in the help system and enables to see the text in a new window.##Related topic : Lists of other topics whiwh are discussing of the same subject. If related topics exist, a button appears in the help system and enables to see the topic list  in a new window.##Keywords : list of keywords which will appear in the index tab of the help system. Each keyword is a link to a particular topic. You can enter more than one keyword for a topic.','#',chr(10)) where help_id=14;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (13,'HELP',1,7,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (14,'HELP',1,8,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (14,'HELP',2,9,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (14,'HELP',3,10,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (14,'HELP',4,11,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (6,'HELP',1,12,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (7,'HELP',1,13,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (8,'HELP',1,14,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (9,'HELP',1,14,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (10,'HELP',1,14,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (11,'HELP',1,14,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (22,'HELP',1,21,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
insert into help_related (help_id,app_name,counter,help_id_related,app_name_related) values (12,'HELP',1,6,'HELP');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_keywords (help_id,app_name,key_id,key_name) values (1,'HELP',2,'Help System');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
insert into help_keywords (help_id,app_name,key_id,key_name) values (5,'HELP',1,'Display On line Help');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
insert into help_keywords (help_id,app_name,key_id,key_name) values (5,'HELP',2,'Forms (developing application)');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
insert into help_keywords (help_id,app_name,key_id,key_name) values (5,'HELP',3,'Key-Help');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
insert into help_keywords (help_id,app_name,key_id,key_name) values (5,'HELP',4,'Context sensitive');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
insert into help_keywords (help_id,app_name,key_id,key_name) values (12,'HELP',1,'Application');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
insert into help_keywords (help_id,app_name,key_id,key_name) values (13,'HELP',1,'Contents');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
insert into help_keywords (help_id,app_name,key_id,key_name) values (13,'HELP',2,'Topics');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
insert into help_keywords (help_id,app_name,key_id,key_name) values (14,'HELP',1,'Help text');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
insert into help_keywords (help_id,app_name,key_id,key_name) values (14,'HELP',2,'Examples');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
insert into help_keywords (help_id,app_name,key_id,key_name) values (14,'HELP',3,'Related topics');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_keywords (help_id,app_name,key_id,key_name) values (14,'HELP',4,'Keywords');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
insert into help_keywords (help_id,app_name,key_id,key_name) values (6,'HELP',1,'Application');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
insert into help_keywords (help_id,app_name,key_id,key_name) values (7,'HELP',1,'Contents');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
insert into help_keywords (help_id,app_name,key_id,key_name) values (8,'HELP',1,'Help text');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
insert into help_keywords (help_id,app_name,key_id,key_name) values (9,'HELP',1,'Examples');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
insert into help_keywords (help_id,app_name,key_id,key_name) values (10,'HELP',1,'Related topics');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_keywords (help_id,app_name,key_id,key_name) values (11,'HELP',1,'Keywords');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
insert into help_keywords (help_id,app_name,key_id,key_name) values (15,'HELP',1,'Buttons');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
insert into help_keywords (help_id,app_name,key_id,key_name) values (21,'HELP',1,'Designer 2000');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
insert into help_keywords (help_id,app_name,key_id,key_name) values (1,'HELP',1,'About');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
insert into help_keywords (help_id,app_name,key_id,key_name) values (21,'HELP',2,'Import help from Designer 2000');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
insert into help_keywords (help_id,app_name,key_id,key_name) values (22,'HELP',1,'Import help from Designer 2000');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
insert into help_keywords (help_id,app_name,key_id,key_name) values (22,'HELP',2,'Designer 2000');                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

 
ALTER TABLE APP_HELP ADD (
      CONSTRAINT PK_APP_NAME
      PRIMARY KEY (APP_NAME)
USING INDEX 
)
/

ALTER TABLE FORMS_HELP ADD (
      CONSTRAINT PK_FORMS_HELP
      PRIMARY KEY (HELP_ID,
                   APP_NAME)
USING INDEX 
)
/

ALTER TABLE HELP_KEYWORDS ADD (
      CONSTRAINT PK_HELP_KEYWORDS
      PRIMARY KEY (HELP_ID,
                   APP_NAME,
                   KEY_ID)
USING INDEX 
)
/

ALTER TABLE HELP_RELATED ADD (
      CONSTRAINT PK_HELP_RELATED
      PRIMARY KEY (HELP_ID,
                   APP_NAME,
                   COUNTER)
USING INDEX 
)
/

ALTER TABLE FORMS_HELP ADD (
      CONSTRAINT FK_FORMS_HELP
      FOREIGN KEY (FATHER_ID,
                   APP_NAME)
      REFERENCES  FORMS_HELP (
                   HELP_ID,
                   APP_NAME)
)
/

ALTER TABLE FORMS_HELP ADD (
      CONSTRAINT FK_FORMS_HELP_APP
      FOREIGN KEY (APP_NAME)
      REFERENCES  APP_HELP (
                   APP_NAME)
)
/

ALTER TABLE HELP_KEYWORDS ADD (
      CONSTRAINT FK_HELP_KEYWORDS
      FOREIGN KEY (HELP_ID,
                   APP_NAME)
      REFERENCES  FORMS_HELP (
                   HELP_ID,
                   APP_NAME)
)
/

ALTER TABLE HELP_RELATED ADD (
      CONSTRAINT FK_HELP_RELATED
      FOREIGN KEY (HELP_ID_RELATED,
                   APP_NAME_RELATED)
      REFERENCES  FORMS_HELP (
                   HELP_ID,
                   APP_NAME)
)
/

ALTER TABLE HELP_RELATED ADD (
      CONSTRAINT FK_HELP
      FOREIGN KEY (HELP_ID,
                   APP_NAME)
      REFERENCES  FORMS_HELP (
                   HELP_ID,
                   APP_NAME)
)
/

 CREATE OR REPLACE PACKAGE hlp_tree IS

  TYPE rec_tree IS RECORD 
       (help_level 	number,
        help_id 	number,
        help_title 	varchar2(200),
        help_leaf 	varchar2(1),
        father_id 	number,
        sort_id 	number);

  TYPE tab_rec is TABLE OF rec_tree INDEX BY BINARY_INTEGER;

  TYPE related_type is ref cursor;

     --===================
     -- Function Init_Tree
     --====================
     --	
     -- Description
     --		Read the help system hierarchy, sort the hierarchy on the sort_id
     --         for each level and stores it in a table of records.
     --    	This function is called in the When-New-Form-Instance trigger
     --		in the form.
     --
     -- Arguments
     --		p_app_name	Application identifier
     --
     -- Returns
     --		tab_rec		table of record
     --
  FUNCTION init_tree (p_app_name varchar2) return tab_rec;

     --==========================
     -- Procedure Related Topics
     --==========================
     --	
     -- Description
     -- 	Read the help_related table if the cursor is called 
     --		from the button related topics in the form
     --		or read the help_keywords table if the cursor is
     --         called from the index tab page in the form.
     --
     -- Arguments
     --		c_related	Ref Cursor used as data source in the block
     --		p_from		indicates the origin of the call
     --				(RELATED or KEYWORDS)
     --		p_id		Help id to find
     --		p_app		Application name to find
     --		p_key		Keyword to find if the origin is KEYWORDS
     --
  PROCEDURE Choose_Related_topics (c_related In Out related_type,
                                   p_from varchar2,
                                   p_id number,
                                   p_app varchar2,
                                   p_key varchar2);
END;
/
CREATE OR REPLACE PACKAGE BODY hlp_tree IS

  FUNCTION init_tree (p_app_name varchar2) return tab_rec
  is
     Cursor C_tree is
        select level help_level,
               help_id,
               lpad(' ',7*(level-1))||help_title help_title,
               'Y' help_leaf,
               father_id,
               sort_id
        from forms_help
        where app_name=p_app_name
        connect by prior help_id= father_id
        start with father_id is null;

     tab_tree 	tab_rec;
     nb_leaf 	number;
     z 		number;
     bool 	boolean;

  begin
     for r_tree in c_tree loop
       select count(*) into nb_leaf
       from forms_help
       where father_id = r_tree.help_id;
       if nb_leaf > 0
       then
          r_tree.help_leaf := 'N';
       end if;
       -- 
       -- sort by sort_id in each level
       --
       bool := false;
       if tab_tree.count > 0   -- if the table of record is not empty
       then  
         --
         -- Search a place to insert the record
         --
         for i in 1..tab_tree.count loop
             if bool 
             then 
               exit;
             end if;
             if (tab_tree(i).help_id = r_tree.father_id or
                r_tree.father_id is null) 
             then 
                if r_tree.father_id is not null
                then
                    z := i+1;
                else
                    z := i;
                end if;
             --
             -- We've found the father_id in the table of record
             --
                begin
                   --
                   -- For each record until a smaller level
                   --
                   while tab_tree(z).help_level >= r_tree.help_level loop
                       --
                       -- if a smaller sort_id is found
                       --
                       if tab_tree(z).help_level = r_tree.help_level and
                          tab_tree(z).sort_id > r_tree.sort_id
                       then
                          --
                          -- insert the record in the table to sort by sort_id
                          --
                          for j in reverse z..tab_tree.count loop
                             tab_tree(j+1) := tab_tree(j);
                          end loop;  
                          tab_tree(z) := r_tree;
                          bool := true;
                          exit;
                       end if;
                       z := z+1;
                    end loop;
                    if not bool
                    then
                    --
                    -- insert the record in the table (last sort_id for this level)
                    --
                       for j in reverse z..tab_tree.count loop
                           tab_tree(j+1) := tab_tree(j);
                        end loop;  
                        tab_tree(z) := r_tree;
                        bool := true;
                     end if;
                exception
                    when no_data_found 
                    then
                       --
                       -- insert at the end of the table of records
                       --
                       tab_tree(tab_tree.count+1) := r_tree;
                       bool := true;
                end;    
             end if; 
          end loop;
          --
          -- If no record found with the  father_id => save at the end of the table
          --
          if not bool
          then
             tab_tree(tab_tree.count+1) := r_tree;
          end if;
       else
          --
          -- First record
          -- 
          tab_tree(1) := r_tree;
       end if; 
     end loop;
     return(tab_tree);
  end;


  PROCEDURE Choose_Related_topics (c_related in out related_type,
                                   p_from varchar2,
                                   p_id number,
                                   p_app varchar2,
                                   p_key varchar2) is
  Begin
     if p_from = 'RELATED'
     then
        --
        -- The cursor is called from the button related topics in the form
        --
        Open c_related for
             select help_id_related,app_name_related
             from help_related
             where help_id = p_id 
               and app_name = p_app;
     else
        --
        -- The cursor is called from the index tab page in the form
        --
        Open c_related for
             select help_id help_id_related,app_name app_name_related
             from help_keywords
             where key_name = p_key 
               and app_name = p_app;
     end if;
  end;

end;
/      
  
Grant all on app_help to public;
Grant all on forms_help to public;
Grant all on help_keywords to public;
Grant all on help_related to public;
Grant select on seq_help_id to public;
Grant select on seq_des2k_app to public;
Grant execute on hlp_tree to public;

 
REM this package provides a stored procedure on which a PJC demonstration
REM is based.  The stored procedure returns a String containing a HTML 
REM representation of an employees details as returned from the EMP table

create or replace package emphtml as
  -- define a new record type containing a single element
  type htmlrec is record (html varchar2(2000));

  -- define a table of records based on new record type
  -- a stored procedure must return a table or records to 
  -- the calling Forms block
  type htmltab is table of htmlrec INDEX by BINARY_INTEGER;

  -- define the procedure to return the table of records
  procedure gethtml(ioemptab in out htmltab, iempno number);

end;
/

-- create package body for emphtml
create or replace package body emphtml as
  procedure gethtml(ioemptab in out htmltab, iempno number) as
    hs varchar2(2000) := '';
    emprow EMP%ROWTYPE;
    deptrow DEPT%ROWTYPE;
  begin

    select * into emprow 
    from emp 
    where empno = iempno;

    select * into deptrow
    from dept 
    where deptno = emprow.deptno;

    hs:=hs||'<HTML><BODY>';
    hs:=hs||'<FONT COLOR="BLUE" SIZE=+3>Employee <B><TT>'
          ||'<FONT COLOR="GREEN">'||initcap(emprow.ename)||'</FONT>'
          ||' </TT></B>Details</FONT><HR>';
    hs:=hs||'<TABLE BORDER=0>';
    hs:=hs||'<TR>';	
	
    hs:=hs||'<TR><TD>Empno</TD><TD>'
          ||emprow.empno
          ||'</TD></TR>';


    -- perform some highlighting of the JOB

    if(emprow.job = 'MANAGER') then
      hs:=hs||'<TR><TD>Job</TD><TD><B><I>'    
            ||initcap(emprow.job)
     	    ||'</I></B></TD></TR>';
    else
      hs:=hs||'<TR><TD>Job</TD><TD>'
            ||initcap(emprow.job)
            ||'</TD></TR>';
    end if;   

    hs:=hs||'<TR><TD>Sal</TD><TD>$'
          ||emprow.sal
          ||'</TD></TR>';

    
    -- perform some highlighting of the COMMISION

    if(emprow.comm = 0) then
      hs:=hs||'<TR BGCOLOR="RED"><TD>Comm</TD><TD>$'
            ||emprow.comm
            ||'</TD></TR>';	
    elsif(emprow.comm is NULL) then
      hs:=hs||'<TR><TD>Comm</TD><TD>N/A</TD></TR>';	
    elsif((emprow.comm/emprow.sal) > .50) then
      hs:=hs||'<TR BGCOLOR="GREEN"><TD>Comm</TD><TD>$'
            ||emprow.comm
            ||'</TD></TR>';	
    else
      hs:=hs||'<TR><TD>Comm</TD><TD>$'
            ||emprow.comm
            ||'</TD></TR>';
    end if;

    hs:=hs||'<TR><TD>Hiredate</TD><TD>'
          ||emprow.hiredate
          ||'</TD></TR>';
    hs:=hs||'<TR><TD>Department</TD><TD><I>'
          ||initcap(deptrow.dname)
          ||'</I></TD></TR>';
    hs:=hs||'</TABLE>';
    hs:=hs||'</HTML></BODY>';						
    ioemptab(0).html := hs;	
  end;

end;
/

commit;

exit;