Re: [sqlite] Create multipe tables, many-to-many design

2019-08-14 Thread Keith Medcalf
sqlite.org] On Behalf Of Keith Medcalf >Sent: Wednesday, 14 August, 2019 11:33 >To: SQLite mailing list >Subject: Re: [sqlite] Create multipe tables, many-to-many design > > >On Monday, 12 August, 2019 14:05, dboland9 >wrote: > >>Hiking_Table

Re: [sqlite] Create multipe tables, many-to-many design

2019-08-14 Thread Keith Medcalf
> UNIQUE (date, destination) should of course be UNIQUE (start, destination) >create index HikedTrails on HikeTrail (hike_id, trail_id); >create index TrailsHiked on HikeTrail (trail_id, hike_id); Both of these should be UNIQUE indexes and could be declared in the create table ... and of cou

Re: [sqlite] Create multipe tables, many-to-many design

2019-08-14 Thread Keith Medcalf
On Monday, 12 August, 2019 14:05, dboland9 wrote: >Hiking_Table Trails_Table >Joining_Table >- - -- >- >hike_id PK trail_id PK >hike_id FK >hike_date TEXT

[sqlite] Create multipe tables, many-to-many design

2019-08-14 Thread dboland9
I'm doing an app. that uses sqlite, and has a many-to-many relationship. The areas I need some guidance are: * Best way to create multiple tables the first time the app. is started. * How to create a MTM relationship and add/modify data. I can create tables (Python) by putting the code in discre