"Sica, Bill" wrote:

> For instance, say the book price is
> $19.44. You also have a base cost of $18, and 8% tax. You can always write a
> query to find out the total cost of any book, and get rid of anything to do
> with the total cost in your tables.

For all the people who've never designed long-term databases, it should be stated:

If you sell a book or buy a book at a given price, nothing says that price will be
the same the next day.

books: id, name ...., price
sales: id, date, customer
soldbooks: book_id, sales_id, price <- this is the price, copied from "books.price"
at the time of creation of the new entry because the book price might change in the
future, and then your sales history is wrong.

--
Michael T. Babcock (PGP: 0xBE6C1895)
http://www.fibrespeed.net/~mbabcock/




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to