Привет. Я пытаюсь вставить внешний ключ, когда создаю таблицу в py mysql, но получаю ошибку. Это мой код:
cur.execute('''CREATE TABLE IF NOT EXISTS artist(id int PRIMARY KEY NOT NULL AUTO_INCREMENT, full_name varchar,
FOREIGN KEY (id) REFERENCES song(artist_id))''')
cur.execute('''CREATE TABLE IF NOT EXISTS Song(id int PRIMARY KEY NOT NULL AUTO_INCREMENT, name varchar,
artist_id int, entry_date timestamp, entry_position int)''')