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

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



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Levente wrote:
> Duncan Drennan <duncan.drennan@xxxxxxxxx> wrote:
>>> I'm back from Stuttgart where I could hack a bit on my database stuff.
>>> Now, I have a command line SQL client, which can be used as a chooser. It
>>> takes command line arguments as search parameters, and makes an SQL query, and
>>> prints the result.
>> Levente, where could I find out more about what exactly your programme does?
> 
> I am about to write a README for it, and check it into my CVS repository, but
> my washingmachine died, so I have to go to my parents to do the whashing.
> 
> But in a nutshell, it looks up a component from a mySQL database, and
> parse the result. The database is online, and so you can see what is
> inside.
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 ...

just my 2 cents
- - cl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHANmIWo2QgtqY4K8RAtyYAJ9m11dGqSWzTltEn30KZ9DFGt588gCdEx85
fWn70h7CVqRIn/aFO1TVn6w=
=MW9k
-----END PGP SIGNATURE-----


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