[thelist] Database schema

Ken Schaefer ken at adOpenStatic.com
Tue Dec 9 20:17:59 CST 2003


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Cosmin G" <cosming at as.ro>
Subject: [thelist] Database schema


: Hi. I've been asked to develop a database for a computer website.
: Right now I have the following tables:
: categories (1 - cpu's, 2 - hard-drives, )
: producer
: product
: exchange rate
: All products have some common values (price, warranty
: period, description) and there are some fields which are
: product specific (such as cpu frequency, cpu cache memory,
: etc). Right now I've stored all the product specific
: fields in the products table and prefixed them with the name
: of the category they refer to. Is this a good approach or
: should I put them in separate tables? The table is
: getting pretty unmanageable already.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


In order to solve this type of problem (given two+ possible ways of
designing my tables):
a) You *must* have an ER/EER diagram (or model, or whatever you want to call
it).
b) You *must* have some kind of systems model (a detailed DFD - or data flow
diagram is probably most helpful in this situation).

DO NOT start seriously modelling your data until you have (a) and (b) above
(you certainly can play around with various types of things, but once you
seriously start writing code, it'll become vastly more expensive to change
the underlying database design).

If you have both of these, then the database schema will write itself.

Seriously, you need to use the tools that are out there that have been
developed to solve exactly these types of problems ("what database schema
should I use?")

Once you have these things, then come back to us about any of the other
thornier issues you may be having.

Cheers
Ken

Microsoft MVP - Windows Server (IIS)



More information about the thelist mailing list