I have to create database of student having different subjects and marks in respective subjects.
Now many students will many subjects so there is many to many relationship.
My database design:
Table 1:
Student table
(PK)Stud_id, Stud_name
Table 2:
Subject table
(FK)Stud_id, Sub_id, Sub_name, Marks.
Table 3:
Stud_Sub table
Stud_id, Sub_id
1) is this design is right or wrong?
2) Secondly i want to find name of the student who scored second highest marks.