I am creating many to many mapping as per the example given in this link
Example
The example works fine but when I add another Student later with an existing course like Maths it duplicates the course table.
I want that after executing the above code my course and student_course table should look like this....
COURSE
========================
|COURSE_ID|COURSE NAME|
-------------------------------------
|2 |Computer Science|
--------------------------------------
|3 |Maths |
-------------------------------------
STUDENT_COURSE
========================
|STUDENT_ID|COURSE_ID|
---------------------------------
|1 |2 |
|1 |3 |
|4 |2 |
|4 |3 |
|5 |3 |