AS

cursor.execute("""CREATE TABLE users_ids(
id INTEGER PRIMARY KEY,
user_id TEXT)""")
cursor.execute("""CREATE TABLE posts(
post_id INTEGER PRIMARY KEY,
likes INTEGER)""")
cursor.execute("""CREATE TABLE likes(
user_id INTEGER,
post_id INTEGER,
PRIMARY KEY (user_id, post_id),
FOREIGN KEY (user_id) REFERENCES users (user_id),
FOREIGN KEY (post_id) REFERENCES posts (post_id) )""")
