SQL manipulation Primary Key vs Foreign Key


#1

I’m on excersice 6 and it cannot find table classes and students, so I’m stuck, this is my query:

SELECT *
FROM students
JOIN classes
   ON classes.id = students.class_id;

the error is: Error: near line 1: no such table: students

https://www.codecademy.com/courses/learn-sql-multiple-tables/lessons/multiple-tables/exercises/primary-key?action=lesson_resume&course_redirect=learn-sql


#3

I’m getting the same error on several occasions. The error keeps re-appearing even when nothing is entered. I submitted a bug report.


#4

I got the same error message since my data was still attached to the previous page. I exited the lesson and re-entered and it worked.


#5

Try the below code
SELECT *
FROM classes
JOIN students
ON classes.id = students.class_id;


#6

It works!! thanks you! I think the order is the problem.