[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: database driven component chooser - part II



Christoph Lechner <cl0023@xxxxxxx> wrote:
> OK. I took a look at the database. So a question came to mind when I saw
> the layout of the 'device' table:
> Why do you store the relationship between entries in the 'device' table
> and entries in the 'supplier' table in fields named supplier*,
> ordering_code*, price* in the 'device' table? What if there are more
> than 3 suppliers for any given part?
> 
> As the relation between 'device' and 'supplier' is a many-many
> relationship, you'd be better off creating just another table, holding
> the device's ID, the ID of the supplier and fields for the ordering_code
> and the price. Then you only need to LEFT JOIN the tables
> rel-device-supplier and supplier and you get all suppliers for a given
> part. This would give you a somewhat tidier DB layout ...

Ok,

I have modified the structure of my database. Thank's for the hint.


-- 
Levente
http://web.interware.hu/lekovacs



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user