
34 PUZZLE 9 AVAILABLE SEATS
PUZZLE
9 AVAILABLE SEATS
You have a restaurant with 1,000 seats. Whenever a waiter puts
someone at a seat, he logs it in a table of seats (I was going to say “table
of tables” and make this impossible to read). Likewise, when a guest
finishes a meal, you remove the guest’s seat number. You want to write a
query to produce a list of the available seats in the restaurant, set up in
blocks by their starting and ending seat numbers. Oh yes, the gimmick
is that the database resides on a personal digital assistant and not a
mainframe computer.
As part of the exercise, you must do this with the smallest amount of
storage ...