Re: [sqlite] How to use PRIMARY KEY AUTOINCREMENT when modelling weak entities?

2008-09-05 Thread Andreas Ntaflos
On Friday 05 September 2008 22:43:15 Nicolas Williams wrote: > On Fri, Sep 05, 2008 at 09:31:43PM +0200, Andreas Ntaflos wrote: > > In the Room table the primary key is a combination of two attributes. How > > could I auto-increment the roomID? "roomID INTEGER AUTOINCREMENT" is > > syntactically in

Re: [sqlite] How to use PRIMARY KEY AUTOINCREMENT when modelling weak entities?

2008-09-05 Thread Dennis Cote
Andreas Ntaflos wrote: > > Naturally a room cannot be identified without a building so it is a weak > entity (this seems to be the canonical example in all database books I've > seen). > That is only true if you allow the same roomID to be used in multiple buildings (i.e. there exists a room

Re: [sqlite] How to use PRIMARY KEY AUTOINCREMENT when modelling weak entities?

2008-09-05 Thread Nicolas Williams
On Fri, Sep 05, 2008 at 09:31:43PM +0200, Andreas Ntaflos wrote: > In the Room table the primary key is a combination of two attributes. How > could I auto-increment the roomID? "roomID INTEGER AUTOINCREMENT" is > syntactically incorrect and the AUTOINCREMENT keyword seems to cannot appear > any

[sqlite] How to use PRIMARY KEY AUTOINCREMENT when modelling weak entities?

2008-09-05 Thread Andreas Ntaflos
Hi list, this question is about the AUTOINCREMENT usage in SQLite when modelling weak entities. Suppose there are two tables 'Building' and 'Room': CREATE TABLE Building ( buildingID INTEGER PRIMARY KEY AUTOINCREMENT, ... ); CREATE TABLE Room ( roomID INTEGER, buildingID INTEGE