osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Create multiple sqlite tables, many-to-many design


On Tue, 13 Aug 2019, Dave via Python-list wrote:

> I do indeed. I did that so it was easy for everyone to follow. Having
> started with assm. and C, I have to remind myself to be more explanatory
> in naming. Guess I over-did it. The actual code is different. htbl, ttbl,
> jtbl, etc. Too short?

Dave,

I encourage you to step back and approach your project from a different
side. Databases, especially relational ones using SQL, are a very different
world from Assembly, C, Python, and other procedural/functional/whatever
languages.

Read Joe Celko's books, starting with his SQL Programming Guide, then SQL
for Smarties. A book on relational database design (other than these) would
help. One I've used is Van der Laans' 'Introductory SQL'.

SQL is a set language and thinking in sets is different from thinking in
step-wise procedures. With SQL to tell the engine what you want, not how to
do it. The engine decides the optimal way of getting the results you want
from the tables.

There are three components of SQL; most of us use only two of them: DDL
(Data Definition Language) to define tables and relationships and DML (Data
Manipulation Language) which we use to write queries.

When you get your head around all this consider using Python and SQLAlchemy
with SQLite3, postgresql, or whatever you want for the database back end.

Good luck!

Rich