Create multiple sqlite tables, many-to-many design

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Aug 15 05:35:59 EDT 2019


Chris Angelico wrote:
> I prefer to say "Trails" for the table, and "Trail" would then refer
> to a single row from that table.

That makes sense for a data structure in your program that contains a
collection of rows. But I've come to the view that SQL tends to read
better if the names of the database tables are singular, because in SQL
you're writing assertions about individual rows, not the tables in
their entirety.

So I would write something like

    select T.name, T.id from Trail T

but I would assign the resulting list of rows to a variable named
"trails" in my program.

-- 
Greg



More information about the Python-list mailing list