i am trying to create a database for subject prerequisite this is my current table.
"student"
-----------------------
|studentID | FullName |
-----------------------
|1234 | John |
|1235 | Michael |
|1236 | Bryce |
"subject_bsit"
-----------------------------------------
|subject_id| subject_name | pre_id |
-----------------------------------------
| 1 | Programming 1 | NULL |
| 2 | Networking | NULL |
| 3 | Algorithm | NULL |
| 4 | Physical Educ | NULL |
| 5 | Programming 2 | 1 |
This is the Junction table to connect the two now.
"student_subject"
------------------------------------------------
| student_id | subject_id | Grade | Enrolled |
------------------------------------------------
| 1235 | 1 | 0 | 0 |
| 1235 | 2 | 0 | 0 |
| 1235 | 3 | 0 | 0 |
| 1234 | 1 | 0 | 0 |
Example if studentID 1235 still doesn't take the subject_id 1 which is programming 1 the user cannot add the subject_id 5 that is programming 2 because it is the prerequisite of programming 1.
i don't know if my table is correct. If it is correct how can i design that database i don't know how can i connect the prerequisite to subject and and the student id thank you so much.