my code :
create table courses(
id SERIAL PRIMARY KEY
)
----------------------
create table teachers(
id SERIAL PRIMARY KEY
)
----------------------
CREATE TABLE assignments(
id SERIAL PRIMARY KEY ,
given_date TIMESTAMP,
deadline TIMESTAMP,
FOREIGN KEY(course_id) REFERENCES courses(id),
FOREIGN KEY(teacher_id) REFERENCES teachers(id),
pass_mark INT,
full_mark INT,
description TEXT,
assignment_file VARCHAR(100)
);
error:
column "course_id" referenced in foreign key constraint does not exist
SQL state: 42703
i tried running the third create table code after inserting data in the courses and teachers table's id yet no change.