
94 PUZZLE 23 MAGAZINE
PUZZLE
23 MAGAZINE
This one was posted on the Sybase forum of CompuServe by Keith
McGregor in November 1994. One of his end users came to him with
the following query. After nearly three days of trial and error, he still did
not have a clue how to tell her to do it. He could have done this in about
30 minutes using COBOL and flat files, but did not see any way to do it
in SQL. This is a good exercise in switching from a procedural mind-set
to a declarative one.
You are given the following tables for a magazine distribution
database:
CREATE TABLE Titles
(product_id INTEGER NOT NULL PRIMARY KEY,
magazine_sku INTEGER NOT NULL, ...