Hi Friends,
I am newbie to Database technologies. Can anyone please help me with this. Which of the following is the best way in defining relationship between two entities?
SCHEME 1
Table - Course
Course_id
Course_Name
Course_details
Table- Student
Student_id
Student_Name
Student_Roll No.
Course_id
SCHEMA 2
Table - Course
Course_id
Course_Name
Course_details
Table- Student
Student_id
Student_Name
Student_Roll No.
Table Student_Course
Student_id
Course_id
As per my understanding in SCHEMA 1, by having course_id column in student table we imply that every student must have a course, i guess i am right? Whereas in SCHEMA 2, we mean that course and student exist independent of each other and there may be a relationship between them.
How do we look at these schemas when we develop an application over it, from same point of view as i did? I mean we can force to select or enter a course for a student record in SCHEMA 2 using application logic or we can skip (by passing null value) course details of a student in SCHEMA 1.
For example somebody is entering bulk records of students in the system and he may or may not aware of student's course and may want to skip for the moment? Which schema should be chosen in this case?
Above scenario was built for two tables, how about having multiple relationships e.g student_exam, student_sport, student_activity etc ?
Bookmarks