On 31 Aug 2017, at 6:44pm, John R. Sowden <jsow...@americansentry.net> wrote:
> I have been using the xbase language (dbase, foxpro, etc.) for about 36 > years, writing applicatios for my alarm company, so each database is a > separate file for me. For the last 21 years, I have been using Linux, and > have found that sqlite is my best match for Linux database use. > > What I fail to understand is how I set up my files/databases. I have > categories that I write for: accounting, dispatching, service, billing, etc. > Some (most) of these use customer data, so when I am writing code for the > billing program, and I want to reference the customers, is that a separate > file, so I only have 1 customer file to update (the relational model)? I’m going to let other people answer your question, but I wanted to give you some words to use in thinking about it because SQL doesn’t work the same way as xbase. When using SQLite, a database is a file on disk. Generally speaking each SQLite application has one database open at one time. Behind the scenes SQLite creates temporary files, journal files, etc. depending on what you’re doing, but as far as your code is concerned you’re only worried about one file per database. A collection of similar things is a table. So you will have a table of customers, a table of orders, a table of despatches, etc.. Each database can hold many tables. It’s normal to have all the tables one application would need at one time in a single database. So your program would open one database (one file on disk) and in that would be all your customers, orders, customer service tickets, etc.. an application can ignore any tables it doesn’t care about. So your salespeople don’t need to see your customer service tickets, and your customer care people don’t have to see your dispatches. Now, there are some unusual situations where you might want to hold your customers in a different database from your invoices and use SQLite to hold both databases open at once using ATTACH. I’ll let other people argue about that. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users