Reply to Re: SQL relationships and identities

Your name:

Reply:


Posted by Doug on 12/12/05 02:34

is order_id unique? In other words, do YOU define the order, or does
the customer? If YOU, then would there ever be a reason to restart
numbering, consolidating, or otherwise restarting? Would you ever
"change" the order number for a specific order?

I'd say in general that you would be better off to define an order
using an identity key. This will assign it a number that no end user
will ever see. You never know what the future might bring.
For the "order" "row", you will have attributes. The date of the
initial order, hte "order year", the customer, etc.
You will also have a different table of "order items." Each row will
have ANOTHER unique identity key. It will also have the Order identity,
line item, part ordered, etc.

Then, build generic code you will use over and order that does a
"select order year, order number, orderid, line item, etc etc from
ORDERS left outer join ORDERDETAIL on Orders.orderid =
ORDERDETAIL.orderid where blah blah blah"

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация