
PUZZLE 44 PAIRS OF STYLES 179
PUZZLE
44 PAIRS OF STYLES
Abbott de Rham posted this problem on the ACCESS Forum in
September 1996. He gets data from sales slips that show pairs of items in
the order they are collected at the point of sale. The table looks like this:
CREATE TABLE SalesSlips
(item_a INTEGER NOT NULL,
item_b INTEGER NOT NULL,
PRIMARY KEY(item_a, item_b),
pair_tally INTEGER NOT NULL);
The table is arranged by the style that shows up first on an order as
item_a, and item_b is always the item that came after item_a on the
order. The table will also include pairs where the paired values are the
same style.
SalesSlips
item_a item_b pair_tally ...