The Bill-Spliting Database Problem

By ET

A few of us assistant professors have small gathering parties every once in a while.  We normally go out into the town to find some good food and go to a bar afterwards.  Usually one of us will be the host and be in charge of finding these places, and pay the bill up front.

Now there is an interesting problem related to paying back these bills.  It is inconvenient to pay cash after each gathering, and we don’t normally see each other quite often unless in the gatherings.  It is therefore most convenient to setup a database to automatically clear out our bills among us.  In terms of participants, sometimes, one or two of us will be missing, so the DB can not just deduct some amount from all participants.  Sometimes, someone of us may only go to the restaurant or only go to the bar, therefore, the bill should be separate for the restaurant and the bar.

The database should work like this.  After each gathering, the host should select participants to the restaurant and the bar respectively and input the total bill  amount, the DB should calculate how much each of the participants owe the host, and automatically clear out the mutural payment.

The question is how to represent the whole process in the database and use the most efficient way to implement it.  Ideally this DB should be web-based so everyone can check the status at any time, and track the whole payment/billing history.

Leave a Reply


BlogTimer
You are visitor number several since September 1, 2001

Copyright Xiaoquan (Michael) Zhang, 2004-2007. All rights reserved.
All trademarks property of their owners.