Re: [sqlite] Associating items of a column with one item of another column

2010-01-08 Thread P Kishor
On Fri, Jan 8, 2010 at 7:23 AM, P.C. wrote: > Good evening, > > Suppose I have a text file named forms.txt with the following content: > > form1|root1 > form2|root1 > form3|root1 > form4|root2 > form5|root2 > form6|root2 > form7|root3 > > Here, I use the character "|" for

Re: [sqlite] Associating items of a column with one item of another column

2010-01-08 Thread Pavel Ivanov
Probably these commands would help: CREATE TABLE temp_forms (form TEXT, root TEXT); .separator "|" .import forms.txt forms CREATE TABLE roots(id INTEGER PRIMARY KEY, root TEXT); INSERT INTO roots (root) SELECT DISTINCT root FROM temp_forms; CREATE TABLE forms (form TEXT, root INTEGER); INSERT

[sqlite] Associating items of a column with one item of another column

2010-01-08 Thread P.C.
Good evening, Suppose I have a text file named forms.txt with the following content: form1|root1 form2|root1 form3|root1 form4|root2 form5|root2 form6|root2 form7|root3 Here, I use the character "|" for separating columns. Then, I create a database and give it the following commands: CREATE