Re: database design of products catalogue - Mailing list pgsql-general

From Paul Thomas
Subject Re: database design of products catalogue
Date
Msg-id 20030721151224.A4043@bacon
Whole thread Raw
In response to database design of products catalogue  (Terence Ng <ngterry2000@yahoo.com.hk>)
List pgsql-general
On 21/07/2003 13:04 Terence Ng wrote:
> Hi!
>
> I would like to create a database for products
> catalogue.  I have many products with different
> specification.
>
> e.g.
> lamp A: Part no, Color, Raw Material, Wave length,
> Vf(V)20mA, lv(ucd)10mA
>
> ECG:Part no, Type, Iv, KHz, A, W, Im
>
> Should I put these products in one table, or in
> separate?
>

You might be able to do it as one table. Whether that would be the best
design, I cannot say. Personally I would approach the problem from 2
different angles.

Firstly I would would list all the possible attributes a part could
possibly have. For parts which don't possess a particular attribute, store
a null in that column. Draw up a grid or spreadsheet of columns/parts and
put an X in every column which would be null for a particular part. If you
get lots of X's then a single table might not be the best solution.

Secondly, look at the application from the user's perspective (the use
cases). What attributes are to be displayed for different parts? Are they
all similar? Do the screens make separate tables seem more natural?


HTH


--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Checkpoint question
Next
From: u15074
Date:
Subject: Re: Checkpoint question