ISQL and Tools

oi_itemnum VARCHAR(6) );

CREATE INDEX orderitem ON orderitems (oi_ordernum, oi_seqnumber);

CREATE TABLE itemmast (

im_weight

INTEGER,

im_price

MONEY,

im_itemnum

VARCHAR(6),

im_desc

VARCHAR(48) );

CREATE INDEX itemnum ON itemmast (im_itemnum);

CREATE TABLE custmast ( cm_custnum VARCHAR(5),

cm_zip VARCHAR(10), cm_state VARCHAR(3), cm_rating VARCHAR(2),

cm_name VARCHAR(48), cm_address VARCHAR(48),

cm_city VARCHAR(48));

CREATE INDEX custnum ON custmast (cm_custnum);

COMMIT WORK;

DELETE FROM ORDERLIST;

DELETE FROM ORDERITEMS;

DELETE FROM ITEMMAST;

DELETE FROM CUSTMAST;

COMMIT WORK;

INSERT INTO orderlist VALUES ('9/1/2002', '9/5/2002', '1', '1001'); INSERT INTO orderlist VALUES ('9/2/2002', '9/6/2002', '2', '1002');

INSERT INTO orderitems VALUES ('1',

1,

2,

'1');

INSERT INTO orderitems VALUES ('1',

2,

1,

'2');

INSERT

INTO

orderitems

VALUES

('1',

3,

1,

'3');

INSERT

INTO

orderitems

VALUES

('2',

1,

3,

'3');

INSERT INTO itemmast VALUES (10, 19.95,

'1', 'Hammer');

INSERT INTO itemmast VALUES (3,

9.99,

'2', 'Wrench');

INSERT

INTO

itemmast

VALUES

(4,

16.59,

'3',

'Saw');

INSERT

INTO

itemmast

VALUES

(1,

3.98,

'4',

'Pliers');

INSERT INTO custmast VALUES ('1000', '92867', 'CA', '1', 'Bryan Williams','2999 Regency', 'Orange');

INSERT INTO custmast VALUES ('1001', '61434', 'CT', '1', 'Michael Jordan', '13 Main', 'Harford');

INSERT INTO custmast VALUES ('1002', '73677', 'GA', '1', 'Joshua Brown', '4356 Cambridge', 'Atlanta');

INSERT INTO custmast VALUES ('1003', '10034', 'MO', '1', 'Keyon Dooling','19771 Park Avenue', 'Columbia');

COMMIT WORK;

COLUMN cm_name FORMAT "A15" heading "NAME"

A-2

FairCom Corporation

Page 92
Image 92
HP c-tree-SQL ISQL and Tools manual Integer, Money, VARCHAR6