Page 283 - Trackpad 402_Class-X_Final
P. 283

Types of Relationships
            There are three important types of relationship that can be created in a database which are as follows:

            •  One to one: In this type “Each record of one table is related to only one record of another Table”. It is represented
              as a 1:1 relationship.
              In the above created table. ONE STUDENT can be in ONE CLASS in a session.
            •  One to many: In this type “Each record of one table is related to multiple Records of another table.” It is represented
              as a 1:n relationship.

               Let us take the example of the above tables where ONE STUDENT can have MULTIPLE SUBJECTS. Similarly, ONE
              TEACHER teaches MULTIPLE CLASSES.
            •  Many to many: In this type “Each record of one table is related to multiple records of another table. Similarly, each
              record of the second table is related to multiple records of the first table.” It is represented as a n:n relationship.
              In the above tables ONE TEACHER can teach MANY SUBJECTS.  ONE SUBJECT is taught by MANY TEACHERS.

            Steps for Creating Relationships
            Steps to create relationships are as follows:

            Step 1:  After creating all 5 tables discussed earlier, click on Tools menu. A drop-down menu will appear.
            Step 2:  Select Relationships option from the menu.


























            Step 3:  The Add Tables dialog box opens. Select TEACHERS table and click on Add button.
            Step 4:  Select SUBJECTS table and click on Add button. These two tables will appear as shown below:
























                                                                                   Database  Management System  283
   278   279   280   281   282   283   284   285   286   287   288