I have to database tables \"Courses\" and \"Students\".
This is a classic case of many-to-many, and for that, you'll need a third table between Course and Student. The schema will look something like this:
Course
table has columns ("course_id", "course_name")
Student_course
table has columns ("student_id", "course_id");
Student
table as columns ("student_id", "student_name")
Student_course table has foreign key constraints on both student and course tables.
Example data:
Course:
id | name
------------------
1 | Maths
2 | English
3 | Science
Student
id | name
---------------
1 | Tom
2 | Dick
3 | Harry
Student_course
student_id | course_id
------------------------
1 | 1
1 | 2
2 | 1
3 | 3
In this example, Student 1 (Tom) is on courses 1 and 2 (Maths, English),
Student 2 (Dick) is on course 1 only (Maths)
Student 3 (Harry) is on course 3 only (Science)