Let's say I have 2 entities Student and Class with many to many relationships. Usually, in the textbook, it is recommended that we create another associative table (maybe called Enrollment) to convert many-to-many relationships becoming 2 one-to-many relationships.
So this design above is correct and I have no problem with it.
However, I also thinking of a more simple design like this
Student
id name class_id
1 Jake 1
2 Jake 2
3 John 1
Class
id name
1 Math
2 English
3 Physics
And I think it can also work fine without even creating the third tables. (and only Student table has the foreign key)
So my question is what are the pros and cons of the second method ( without associate tables). Is there any particular case that making the text-book method (1st solution) better than the 2nd solution and vice versa. Thanks