Re: Database Design for Shopping Cart

From: Tobin Harris <comedyharris_at_hotmail.com>
Date: Mon, 13 May 2002 01:17:32 +0100
Message-ID: <abn0i0$jjopa$1_at_ID-135366.news.dfncis.de>


> Well, that spec is so general as to be useless to anyone ...

This response is a tad harsh IMHO, although you're right - the poster should have given more details.

> Also, stop putting those silly "tbl-" prefixes on table names and
> start using plural or collective nouns for them -- unless there really
> is only one shopping cart.

I don't quite understand. Whether something is collective or not is surely determined by the cardinality of the relationship between tables? For example, a Customer has zero or more Orders, but a lineitem has one Order. You could argue that both Order and Orders are wrong! I suppose that's why the ISO standard recommends the use of collectives, and then using plural is just a second-best option.

Just out of interest, what's the reasoning behind not including things like "tbl" in object names? I must admit, this is a ( seemingly bad ) practice I've picked up. I've even known developers to embed meaning in the column names, such as "strCustomerForename". The reason I do it is because it helps me work out what is going on in the code: I find comfort in knowing whether an application is working with a table, a view or a stored procedure. Actually, I may just be being lazy, not wanting to have to lookup the objects type when reading source!

I suppose that ideally the application should be ony concerned with the external view that is exposed to it by the RDBMS. Whether it's a view, at procedure or a table should be irrelevent?

One practice used is to use stored procedures for selecting data, since they are pre-compiled and therefore the optimiser doesn't have to recalculate the cost on each call. Do you know how this practice is perceived from a standards point of view? Furthermore, should stored procedures also not contain things like "sp" in the name to indeicate object type?

Tobin Harris Received on Mon May 13 2002 - 02:17:32 CEST

Original text of this message