Re: [sqlite] complex query

2011-02-24 Thread Philip Graham Willoughby
On 24 Feb 2011, at 15:20, Simon Slavin wrote: > On 24 Feb 2011, at 3:18pm, Philip Graham Willoughby wrote: > >> On 24 Feb 2011, at 14:07, Simon Slavin wrote: >> >>> A more flexible way to lay out genealogy databases is as follows: >>> >>> Person: id, name, sex, dob >>> >>> Relationship: id1,

Re: [sqlite] complex query

2011-02-24 Thread Simon Slavin
On 24 Feb 2011, at 3:18pm, Philip Graham Willoughby wrote: > On 24 Feb 2011, at 14:07, Simon Slavin wrote: > >> A more flexible way to lay out genealogy databases is as follows: >> >> Person: id, name, sex, dob >> >> Relationship: id1, id2, connection >> >> So you end up with things like >>

Re: [sqlite] complex query

2011-02-24 Thread Philip Graham Willoughby
On 24 Feb 2011, at 14:07, Simon Slavin wrote: > > On 24 Feb 2011, at 1:06pm, Josh Marell wrote: > >> I would say that couple should be a 3 column table, with coupleID, >> partner1ID, partner2ID. It looks like right now, you have just coupleID and >> partnerID, that doubles the number of rows

Re: [sqlite] complex query

2011-02-24 Thread Simon Slavin
On 24 Feb 2011, at 1:06pm, Josh Marell wrote: > I would say that couple should be a 3 column table, with coupleID, > partner1ID, partner2ID. It looks like right now, you have just coupleID and > partnerID, that doubles the number of rows you have. A more flexible way to lay out genealogy

Re: [sqlite] complex query

2011-02-24 Thread Philip Graham Willoughby
On 24 Feb 2011, at 13:40, Igor Tandetnik wrote: > Josh Marell wrote: >> I would say that couple should be a 3 column table, with coupleID, >> partner1ID, partner2ID. It looks like right now, you have just coupleID and >> partnerID, that doubles the number of rows you have.

Re: [sqlite] complex query

2011-02-24 Thread Igor Tandetnik
Josh Marell wrote: > I would say that couple should be a 3 column table, with coupleID, > partner1ID, partner2ID. It looks like right now, you have just coupleID and > partnerID, that doubles the number of rows you have. On the other hand, this would make many queries more

Re: [sqlite] complex query

2011-02-24 Thread Philip Graham Willoughby
On 24 Feb 2011, at 07:49, Aric Bills wrote: > people (a table of individuals who are somehow interrelated) > fields: uid (among others) > > partners (links individuals [i.e., individual spouses] to couple IDs) > fields: coupleid, personid > > children (links children to their parents' couple

Re: [sqlite] complex query

2011-02-24 Thread Josh Marell
I would say that couple should be a 3 column table, with coupleID, partner1ID, partner2ID. It looks like right now, you have just coupleID and partnerID, that doubles the number of rows you have. On Thu, Feb 24, 2011 at 7:02 AM, Igor Tandetnik wrote: > Aric Bills

Re: [sqlite] complex query

2011-02-24 Thread Igor Tandetnik
Aric Bills wrote: > Using the results of this query, I'd like to identify cousins. It should be > possible to define two people as cousins if they share a grandparent but > have no parents in common. Defining the query above as the view > "grandparentage", I can come up

[sqlite] complex query

2011-02-24 Thread Aric Bills
Apologies for the lengthy message. I'm a SQL newbie trying to model family relationships in SQLite (and no, this isn't homework; it's part of an effort to create a computer-based language lesson on kinship terminology). I've created the following tables: people (a table of individuals who are

Re: [sqlite] Complex Query

2008-03-21 Thread P Kishor
On 3/21/08, Derek Developer <[EMAIL PROTECTED]> wrote: > Hello, > > Thank you for your help with SQLite > > > Also I would really like to figure out how to respond to a particular thread > rather than starting a new thread. Is it possible from the digest? I have no idea. I don't subscribe to the

Re: [sqlite] Complex Query

2008-03-19 Thread BareFeet
Hi Derek, > .m col > .h on > .w 20 17 6 23 6 > .e on They are just the abbreviated version of these dot commands: .mode columns .headers on .width 20 17 6 23 6 .echo on You can get info on each by typing ".help" from within the sqlite3 command line utility. Tom BareFeet

Re: [sqlite] Complex Query

2008-03-19 Thread Dennis Cote
Derek Developer wrote: > (2nd attempt... bounced back for some reason...) > > In testing a my code I came across this example. > Could someone help me understand what this syntax is doing please > (from the Seinfeld demo database examples) > > ...m col > ...h on > ...w 20 17 6 23 6 > ...e on >

[sqlite] Complex Query

2008-03-19 Thread Derek Developer
(2nd attempt... bounced back for some reason...) In testing a my code I came across this example. Could someone help me understand what this syntax is doing please (from the Seinfeld demo database examples) ...m col ...h on ...w 20 17 6 23 6 ...e on Is this some form of typecasting? This is

RE: [sqlite] complex query question

2004-09-30 Thread Downey, Shawn
] Subject: Re: [sqlite] complex query question - Original Message - From: "Downey, Shawn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 30, 2004 7:26 PM Subject: [sqlite] complex query question > The query should return exactly 3 record

Re: [sqlite] complex query question

2004-09-30 Thread Lawrence Chitty
- Original Message - From: "Downey, Shawn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 30, 2004 7:26 PM Subject: [sqlite] complex query question > The query should return exactly 3 records: > > Hoyhoy | 2 | 1 | 1 > Fred

[sqlite] complex query question

2004-09-30 Thread Downey, Shawn
Hello all, First let me say thank you very much for a very useful mailing list. I have a somewhat complex SQL query question. Given the table: CREATE TABLE times(name CHAR(32) not null, time1 CHAR(10), time2 CHAR(10),