On Tue, Dec 15, 2009 at 6:16 AM, Florian Schricker <fschric...@gmail.com> wrote: > Hello Simon, > > >> From: Simon Slavin <slav...@bigfraud.org> >> On 14 Dec 2009, at 8:52am, Florian Schricker wrote: >> >>>>> Primary keys are Oper, Product, Category, Name and CreateTS >>>> There is only one primary key per table. >>> >>> So to say the primary key is "Oper, Product, Category, Name, CreateTS". >> >> No. >> Go read a boos on databases. The shorter your primary key is, the faster >> everything works. You want a very short primary key. There would be no >> point in putting 'CreateTS' in your primary key unless it's possible for two >> records to exist which have the same "Oper, Product, Category, Name" but >> different CreateTS. >> I might guess that your primary key is probably just Product. If it's not >> possible to have two records with the same 'Product' then that is your >> primary key. > > Please excuse me for being so blunt: > You have no idea what I'm supposed to do here nor do you have any idea > for whatever historic reason the database or table is designed "as is" > here nor (and finally) do you have no idea about my education on > databases or SQL or SQLite in general or in detail so please(!) stop >
You did say in your original post that you are, "a starter on SQL / SQLite and there is some problem (you would) solve in software but (you) have the feeling this can be done using a query. If somebody can help (you) out (you would) be glad - (you) have the feeling there is something to learn for (you) here." Here is the thing 1: Simon, or anyone's advice on this list, is free. The most you should do with it if you disagree with it, unless the person is being downright abusive, is to ignore it. You will lose nothing. Simon's advice, on the other hand, was actually very good. You would do well to heed it. Thing 2: Your schema, even if we know nothing about your problem, demonstrates issues that could bite you in the butt later on. First, instead of having a composite PK made of 5 columns, you would really be better off adding a new INTEGER PRIMARY KEY. Life will become easier on all fronts. Thing 3: If we really have no idea what your situation/problem is, perhaps you should educate us so we can answer you better. If you ask us something, but hide/obfuscate part of the problem, then it wastes everyone's time. This is a nice list. Let's keep it that way please. > a) implying I have no idea whatsoever on what I'm doing > b) suggesting me to "go read a book". > > These actions of yours are rude, not helping in any way and imply I'm > a fool in what I'm doing and a fool to ask. > > On a more constructive side-note: you are completely wrong in your > assumption that my primary key is "just Product". It isn't. Has never > been and will never be. The primary key is as described simply just > because "it's possible for two records to exist which have the same > "Oper, Product, Category, Name" but different CreateTS." > > > regards, > Florian > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= Sent from Madison, Wisconsin, United States _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users