Answer the question
In order to leave comments, you need to log in
Where can I find a simple sample database in Python?
Hello!
Please give me a simple example of creating a database using Sqlite and Python.
Understood how to create base with one table and to fill it.
It's not clear how to create a second table and link it to the first one, i.e. establish a one-to-many relationship.
As an example: there are several authors, and several book titles.
Each author can have multiple books, but only one author corresponds to a book.
Answer the question
In order to leave comments, you need to log in
If without any ORMs, create in the same way, only in the table with books make an additional author_id column, in which the author ID from the first one will be stored for each book.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question