I have created 3 tables like the following
----------------Database name is chiledata.sqlite---------------
CREATE TABLE child (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT
);
----------------Database name is dogdata.sqlite---------------
CREATE TABLE dog (
id INTEGER PRIMARY KEY AUTOINCREMENT,
dog TEXT
);
----------------Database name is dogChilddata.sqlite---------------
CREATE TABLE child_dog {
child_id INTEGER,
dog_id INTEGER,
FOREIGN KEY(child_id) REFERENCES child(id),
FOREIGN KEY(dog_id) REFERENCES dog(id)
};
If I use python for make relationship between these tables and execute "SELECT" query how can I connect these 3 tables for this task?
ex:
#Import the sqlite3 module
import sqlite3
# Create a connection and cursor to your database
conn = sqlite3.connect('chiledata.sqlite')
c = conn.cursor()
So I can connect chiledata.sqlite but how can I connect other two database tables (dogdata.sqlite, dogChilddata.sqlite) to execute SELECT query?