Page 66 - Database-En-V3
P. 66

Creating relationships between tables (joining tables)
             There are three types of table relationships in Access. A
             relationship in Access helps you combine data between
             different tables that were mentioned previously.
             The conditions for creating a relationship between two tables
             are:
             1- You must ensure that both or one of the tables between

                which you want to create a relationship include a similar
                field or fields in the same data type.
             2- One or both of the tables must have a primary key.
             3- You must know who the primary table will be and who will
                be the related table, so that the child table includes a field
                that matches the primary key field in the main table, and if
                it does not exist, add a new field in the child table with the
                same specifications as the primary key field in Main table.
             4- The program determines the type of relationship
                according to the characteristics of the fields used.
             5- The presence of a primary key in one or both tables:
             Create relationships between tables:
             1. Open the Database Tools tab. Database tools
             2. Choose the Relation command from the Tools menu, or
                click the Relationships button on the toolbar, and the
                Relationships window will appear.
             3. Once you open the relationships, the Show Tables screen
                will appear, from which you can choose the tables
                between which you want to establish relationships.
             4. Place the tables inside the workspace as in the following
                figure (by dragging and dropping - inserting)

59 Training unit in the field of technological information - at the Supreme Council of Universities © Intellectual property rights 2024
   61   62   63   64   65   66   67   68   69   70   71