This problem is designed to come up with a solution that uses the smallest amount of storage possible for a 1,000 seat restaurant.
I've come up with a solution that need only 125 bytes of storage. All other solutions covered in Mr Celko's book has at least 1,000 bytes of storage.

Here is my solution, complete with all procedures to assign and release seats, together with views to display current status of each and one seat.

WITHL0AS(SELECT 1 AS c UNIONALLSELECT 1),L1AS(SELECT 1 AS c FROM L0 AS A CROSSJOIN L0 AS B),L2AS(SELECT 1 AS c FROM L1 AS A CROSSJOIN L1 AS B),L3AS(SELECT 1 AS c FROM L2 AS A CROSSJOIN L2 AS B),Nums AS(SELECTROW_NUMBER()OVER(ORDERBY c)- 1 AS Number FROM L3)

SELECTTOP(125)NumberFROMNumsORDERBYNumberGO

-- Create view CurrentSeatingsCREATEVIEW dbo.vwCurrentSeatingsAS

SELECT8 * v.number + b.number + 1 AS Seat,SIGN(SUBSTRING(Seats, 1 + v.number, 1)&POWER(2, b.number))AS TakenFROMdbo.Restaurant AS sINNERJOINdbo.vwNums AS v ON v.Number BETWEEN 0 AND 124INNERJOINdbo.vwNums AS b ON b.Number BETWEEN 0 AND 7GO

Feedback

Hmm.. this smells of a classic computer science problem or perhaps discrete math.. nice implementation even though it brought back my college nightmares. Something about travelling salesman & shortest path as I recall..