
186 PUZZLE 46 SALES PROMOTIONS
PUZZLE
46 SALES PROMOTIONS
You have just gotten a job as the sales manager for a department store.
Your database has two tables. One is a calendar of the promotional
events the store has had, and the other is a list of the sales that have been
made during the promotions. You need to write a query that will tell us
which clerk had the highest amount of sales for each promotion, so we
can pay that clerk a performance bonus.
CREATE TABLE Promotions
(promo_name CHAR(25) NOT NULL PRIMARY KEY,
start_date DATE NOT NULL,
end_date DATE NOT NULL,
CHECK (start_date <= end_date));
Promotions
promo_name start_date end_date
===================================================== ...