On Wednesday 09 June 2004 21:40, Shlomi Fish wrote:
> On Wednesday 09 June 2004 16:50, Amir Hardon wrote:
> > Hi,
> > I'm planning a DB structure for an e-commerce system, and facing some
> > question about the DB efficiency that I don't know how to approach.
> >
> > For example what will be better, storing all items information in one
> > table with one column for category, or having a separate items table for
> > each category.
>
> Doesn't having separate tables contradict one of the Relational Database
> Model Normalization Rules (can't remember which)? Even if it doesn't, it
> seems like a Bad Idea<tm> as far as modularity is concerned.
>
> For once in an SQL statement, you can't select (AFAIR) a table based on the
> value of a select statement. This:
>
> SELECT *
> FROM (SELECT table FROM categories WHERE cat_id = 5)
> WHERE item_id = 103

Just for the protocol: this is possible with mssql and oracle:

http://www.schemamania.org/jkl/booksonline/SQLBOL70/html/2_005_29.htm

>
> won't work. (at least I think it won't.)
>
> Another thing is that you have several tables with the same schema that you
> need to update regularly.
>
> That probably did not answer your question (even tough your guess seems
> correct), but it triggered my opinion bit.
>
> Regards,
>
>       Shlomi Fish
>
> > My guess is that separate tables will be faster for use but will consume
> > more disk space.
> >
> > Where can I learn about this subject? I guess it also depends on the DB
> > backend I'm using, so for this case it is mySQL.
> >
> > Thanks,
> >     -Amir.
> >
> > =================================================================
> > To unsubscribe, send mail to [EMAIL PROTECTED] with
> > the word "unsubscribe" in the message body, e.g., run the command
> > echo unsubscribe | mail [EMAIL PROTECTED]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to