Page 111 - Viva ICSE Computer Studies 7 : E-book
P. 111

Establishing Relationship among Tables


                    Relationships are links that are built on a fi eld of one table with the same fi eld of another
                    table. Access holds multiple tables and these tables hold multiple records. To get information
                    together, a relationship needs to be built among the tables. Once a relationship is built, the
                    data from both the tables can be used by query, form, etc.

                    Follow these steps to build a relationship among tables.
                                                                            Step 4      Step 3



                      1.  Create two tables with a common
                           fi eld.
                                                                                                            Step 2
                      2.  Open one table in ‘Datasheet’ view.

                      3.  Click on the Database Tools tab.             Step 1

                      4. Click  on  the  Relationships  button
                           from the ‘Relationships’ group.




                                                   Step 3                  5.  A  ‘Show  Table’ window will appear
                                       Step 9
                                                                               displaying the list of tables present in
                                                                               the database.

                                                                           6.  Select the required table and click on
                                                           Step 6              the Add button.
                                                                           7.  A selected table will be added to

                                       Step 7                   Step 8         the  ‘Relationships’ window. In a
                                                                               similar way, add another table to the
                                                                               ‘Relationships’ window.
                                                                           8. Click on the Close button to close the
                                                                               ‘Show Table’ dialog box.





                      9. Drag  the  primary key (Roll No) of                                                   Step 10
                           the parent table (Student) and drop
                           it over the same fi eld in the child
                           table (Result).
                      10.  The ‘Edit Relationships’ dialog box

                           will appear. Click on the  Create
                           button.





                                                                                                                    99
   106   107   108   109   110   111   112   113   114   115   116