i have created a few tables for a schoool project. The tables of interest are
//table courses
CREATE TABLE courses(courseId SERIAL PRIMARY KEY, facultyId REFERENCES faculties(facultyId), courseName TEXT);
//table weights
CREATE TABLE weights(weightId SERIAL PRIMARY KEY, weightName TEXT, weight INTEGER);
//table subjects
CREATE TABLE subjects(subjectId SERIAL PRIMARY KEY, subjectName TEXT);
//table weights_subjects_courses
CREATE TABLE weights_subjects_courses(courseId integer REFERENCES courses(courseId), weightId integer REFERENCES weights(weightId), subjectId integer REFERENCES subjects(subjectId)
The problem comes when i try the following query
SELECT * FROM courses, subjects, weights WHERE courses.courseId= weights_subjects_courses.courseId AND subjects.subjectId= weights_subjects_courses.subjectId AND weights.weightId= weights_subjects_courses.weightId ORDER BY courseName;
i get this error SQL error:
ERROR: missing FROM-clause entry for table "weights_subjects_courses"
LINE 1: ...ourses, subjects, weights WHERE courses.courseId= weights_su...
^
Thanks in advance