From: | Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk> |
---|---|
To: | "pgsql-general (at) postgresql (dot) org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: database design of products catalogue |
Date: | 2003-07-21 14:12:24 |
Message-ID: | 20030721151224.A4043@bacon |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 |
+------------------------------+---------------------------------------------+
From | Date | Subject | |
---|---|---|---|
Next Message | nolan | 2003-07-21 14:23:04 | psql and toggles |
Previous Message | Tom Lane | 2003-07-21 14:06:38 | Re: Checkpoint question |