What are Parent and Child Records?
A relational database is a system structured to recognize connections among stored items of information. There are 2 main types of relationships that may exist within your database:
- One-to-one (1:1) Relationship
- One-to-many (1:M) Relationship
Let's imagine an example which will be utilized to demonstrate each of these relationship types. Imagine you have created a database to track university enrollment. Your database could track the following for each student, each captured in a form:
- Course Registration
- Dorm Room Selection
- Vaccinations and Medical Forms
A one-to-one relationship (1:1) means that there is one child record for each individual parent record. Looking at the university registration example, vaccinations and medical forms would be a one-to-one relationship. Each student (existing in the parent form) would submit just one medical form at the beginning of enrollment (which would exist in the child form).
A one-to-many relationship (1:M) means that there is only one parent record and multiple child records. Each semester, a university student must register for a class. Thus, he or she would submit one-course registration form per semester. There would be one student (parent form) with many course registrations (child form) over time.
Additionally, each year a student may wish to choose a new dorm; thus they would submit multiple dorm room selection forms, still connected to just one student.