Tutorial Source Code
COLUMN oi_quantity FORMAT "A10" heading "QTY" COLUMN im_price FORMAT "$99.99" heading "PRICE"
SELECT custmast.cm_name, orderitems.oi_quantity, itemmast.im_price FROM custmast, orderitems, itemmast, orderlist
WHERE orderlist.ol_custnum = custmast.cm_custnum AND orderlist.ol_ordernum = orderitems.oi_ordernum AND orderitems.oi_itemnum = itemmast.im_itemnum
ORDER BY orderlist.ol_custnum;
A.3 LOCKING TUTORIAL
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));
COMMIT WORK;
DELETE FROM CUSTMAST;
COMMIT WORK;
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;
UPDATE custmast SET cm_name = 'KEYON DOOLING' where cm_custnum = '1003';
A.4 TRANSACTION PROCESSING TUTORIAL
CREATE TABLE orderlist (
ol_orderdate DATE, ol_promdate DATE, ol_ordernum VARCHAR(7), ol_custnum VARCHAR(4));
CREATE TABLE orderitems ( oi_ordernum VARCHAR(7), oi_seqnumber SMALLINT, oi_quantity SMALLINT, oi_itemnum VARCHAR(6));
CREATE TABLE itemmast ( im_weight INTEGER, im_price MONEY, im_itemnum VARCHAR(6),
FairCom Corporation |