Class 10 (CH-10)
Class 10 (CH-10)
Ques: 4 Differentiate between one-to-one relationship and one-to-many relationship. Give suitable
examples to explain your answer.
Ans:
One-to-One One-to-Many
In this type of relationship, one specific record In this type of relationship, one specific record
of master table has one and only one of master table has more than one corresponding
corresponding record in the related transaction record in the related transaction table.
table.
Example: One-to-One
Table: Student_details
AdmissionNo Name Father’s name Class DoB
1001 Neha DK Bose 10 10/10/2004 Here AdmissionNo is primary key
1005 Sonia Tej Singh 9 11/05/2005
1110 Ruhi R Reddy 10 05/12/2004
1002 Shivani Rajesh Jain 7 23/11/2007
1134 Priya Pawan Sharma 10 12/09/2004
Table:Student_Result
RollNo AdmissionNo Class Marks
1 1001 10 78 Here AdmissionNo is foreign key. RollNo is
2 1110 10 65 the primary key.
3 1134 10 53
Only One Corresponding Record
Fo example, the record for AdmissionNo in the master table (Student_details) will have only one
corresponding record of same value of AdmissionNo in the transaction table of student_Result. This
is because no two students will be given same admission number.
Example: One-to-Many
Table: Teacher_details
Teacher_id Teacher_Name Subject
T002 Aarti Hindi
T123 Seema Social science
T009 Pinki Sanskrit
T342 Bhawna Science
T765 Nisha History
Table: Class_Allocation
Class Section Subject Teacher_id
10 A Hindi T002 Multiple corresponding record
10 A Science T342
10 B Hindi T002
10 A History T765
9 C History T765
8 A History T765
For example, one teacher can teach multiple students or multiple classes. So we can say that there is
a one-to-many relationship between a teacher and class or teacher and students.
Table: Department_Incharge
Department Teacher_id
Examination T002
Discipline T765
Co_Curricular T056
Time Table T002
Website Update T765
Table: Activity-duty
Activity Department Teacher_id
UT-1 Examination T002
TERM-1 Examination T002
Home work upload Website Update T765
Timetable upload Website Update T765
Inter-house Dance Co_Curricular T056
Inter-class Debate Co_Curricular T056
Discipline duties Discipline T765
For example, a teacher in a school may hold multiple responsibilities such as class teacher, an
activity incharge or examination incharge. For each responsibility the teacher might be attached
with multiple students. So, this type of relationship will be many-to-many relationship.
Similarly, a shopkeeper may sell multiple products to multiple customers. So, many-to-
many relationship exists between a product and a customer.