Download presentation
Presentation is loading. Please wait.
Published bySabrina Appleyard Modified over 10 years ago
1
© Paradigm Publishing, Inc. 1
2
2 Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 2Creating Relationships between Tables
3
© Paradigm Publishing, Inc. 3 Creating Relationships between Tables Create Related Tables CHECKPOINT 1 Create a One-to-One Relationship Display Related Records in a Subdatasheet CHECKPOINT 2 Quick Links to Presentation Contents
4
© Paradigm Publishing, Inc. 4 Create Related Tables Generally, a database management system fits into one of two categorieseither a file management system (also sometimes referred to as a flat file database) or a relational database management system.
5
© Paradigm Publishing, Inc. 5 Create Related Tables…continued Taking time to plan a database is extremely important. Creating a database with related tables takes even more consideration. You need to determine how to break down the required data and what tables to create to eliminate redundancies.
6
© Paradigm Publishing, Inc. 6 Create Related Tables…continued Along with deciding on the necessary tables for a database, you also need to determine the relationship between tables. The ability to relate, or join, tables is what makes Access a relational database system. database diagram
7
© Paradigm Publishing, Inc. 7 Create Related Tables…continued When a new record is added to a table, Access checks to ensure that there is no existing record with the same data in the primary key. If there is, Access displays an error message indicating there are duplicate values and will not allow the new record to be saved. When adding a new record to a table, the primary key field cannot be left blank. Access expects a value in each record in the table and this is referred to as entity integrity.
8
© Paradigm Publishing, Inc. 8 Create Related Tables…continued To display a table in Design view: 1.Open the desired table. 2.Click the View button in the Views group in the Home tab. View button
9
© Paradigm Publishing, Inc. 9 Create Related Tables…continued To add or remove a primary key from a field: 1.Click the desired field in the Field Name column. 2.Click the Table Tools Design tab. 3.Click the Primary Key button in the Tools group. Primary Key button
10
© Paradigm Publishing, Inc. 10 Create Related Tables…continued primary key and associated foreign key Typically, a primary key field in one table becomes the foreign key field in a related table.
11
© Paradigm Publishing, Inc. 11 Create Related Tables…continued In Access, one table can be related to another, which is generally referred to as performing a join. For example, in Project 1b, you will create a relationship between the Suppliers table and the Products table. The relationship you establish will ensure that a supplier number cannot be entered in the Products table without first being entered in the Suppliers table. This type of relationship is called a one-to-many relationship, which means that one record in the Suppliers table will match zero, one, or many records in the Products table.
12
© Paradigm Publishing, Inc. 12 Create Related Tables…continued To create a one-to-many relationship: 1.Open the desired database. 2.Click the Database Tools tab. 3.Click the Relationships button in the Relationships group. continues on next slide… Relationships button
13
© Paradigm Publishing, Inc. 13 Create Related Tables…continued 4.At the Show Table dialog box, click the first table name. 5.Click the Add button. 6.Repeat Steps 4 and 5 until all desired table names have been added. 7.Click the Close button. continues on next slide… Show Table dialog box
14
© Paradigm Publishing, Inc. 14 Create Related Tables…continued 8.At the Relationships window, drag the common field to the related table. continues on next slide… Relationships window
15
© Paradigm Publishing, Inc. 15 Create Related Tables…continued 9.At the Edit Relationships dialog box, check to make sure the correct field name displays and the relationship type displays as One-To- Many. 10.Specify the relationship options. 11.Click the Create button. Edit Relationships dialog box
16
© Paradigm Publishing, Inc. 16 Create Related Tables…continued Choose Enforce Referential Integrity at the Edit Relationships dialog box to ensure that the relationships between records in related tables are valid. Referential integrity can be set if the field from the primary table is a primary key and the related fields have the same data type.
17
© Paradigm Publishing, Inc. 17 Create Related Tables…continued join line In the image below, the Suppliers table displays with a black line attached along with the number 1 (signifying the one side of the relationship). The black line is connected to the Products table along with the infinity symbol (signifying the many side of the relationship).
18
© Paradigm Publishing, Inc. 18 Create Related Tables…continued To print relationships: 1.Click the Database Tools tab. 2.Click the Relationships button. 3.Click the Relationship Report button in the Tools group. continues on next slide… Relationship Report button
19
© Paradigm Publishing, Inc. 19 Create Related Tables…continued 4.Click the Print button. 5.Click OK. 6.Click the Close button. Print button
20
© Paradigm Publishing, Inc. 20 Create Related Tables…continued To display the Show Table dialog box: 1.Click the Show Table button in the Relationships group. Show Table button
21
© Paradigm Publishing, Inc. 21 Create Related Tables…continued To edit a relationship: 1.Click the Database Tools tab. 2.Click the Relationships button in the Relationships group. 3.Click the Edit Relationships button in the Tools group. 4.Make the desired changes at the Edit Relationships dialog box. 5.Click OK. Edit Relationships dialog box
22
© Paradigm Publishing, Inc. 22 Create Related Tables…continued To delete a relationship: 1.Click the Database Tools tab. 2.Click the Relationships button in the Relationships group. 3.Right-click on the black line connecting the related tables. 4.Click the Delete option. 5.Click Yes. Delete option
23
© Paradigm Publishing, Inc. 23 1)Access is this type of database management system. a.flat file b.relational c.directional d.organizational 1)Access is this type of database management system. a.flat file b.relational c.directional d.organizational 3)The infinity symbol signifies this side of the relationship. a.many b.one c.two d.three 3)The infinity symbol signifies this side of the relationship. a.many b.one c.two d.three 2)Typically, a primary key field in one table becomes this key field in a related table. a.figure b.international c.foreign d.secondary 2)Typically, a primary key field in one table becomes this key field in a related table. a.figure b.international c.foreign d.secondary 4)To edit a relationship, click the Relationships button in this tab. a.Home b.Database Design c.Database Tools d.Create 4)To edit a relationship, click the Relationships button in this tab. a.Home b.Database Design c.Database Tools d.Create Next Question Next Slide Answer
24
© Paradigm Publishing, Inc. 24 Create a One-to-One Relationship You can create a one-to-one relationship between tables in which each record in the first table matches only one record in the second table and one record in the second table matches only one record in the first table. one-to-one relationship
25
© Paradigm Publishing, Inc. 25 Create a One-to-One Relationship…continued To create a one-to-one relationship: 1.Open the desired database. 2.Click the Database Tools tab. 3.Click the Relationships button in the Relationships group. continues on next slide… Relationships button
26
© Paradigm Publishing, Inc. 26 Create a One-to-One Relationship…continued 4.At the Show Table dialog box, click the first table name. 5.Click the Add button. 6.Repeat Steps 4 and 5 until all desired table names have been added. 7.Click the Close button. continues on next slide… Show Table dialog box
27
© Paradigm Publishing, Inc. 27 Create a One-to-One Relationship…continued 8.At the Relationships window, drag the common field to the related table. continues on next slide… Relationships window
28
© Paradigm Publishing, Inc. 28 Create a One-to-One Relationship…continued 9.At the Edit Relationships dialog box, check to make sure the correct field name displays and the relationship type displays as One-To-One. 10.Specify the relationship options. 11.Click the Create button. Edit Relationships dialog box
29
© Paradigm Publishing, Inc. 29 Display Related Records in a Subdatasheet When a relationship is established between tables, you can view and edit records in related tables with a subdatasheet. subdatasheet
30
© Paradigm Publishing, Inc. 30 Display Related Records in a Subdatasheet…continued To display a subdatasheet: 1.Click the expand indicator at the left side of the desired record. 2.Click the desired table at the Insert Subdatasheet dialog box. Insert Subdatasheet dialog box
31
© Paradigm Publishing, Inc. 31 Display Related Records in a Subdatasheet…continued To display subdatasheets for all records: 1.Click the More button in the Records group in the Home tab. 2.Point to Subdatasheet. 3.Click the Expand All option. Expand All option
32
© Paradigm Publishing, Inc. 32 Display Related Records in a Subdatasheet…continued To remove a subdatasheet: 1.Click the More button in the Records group in the Home tab. 2.Point to Subdatasheet. 3.Click the Remove option. Remove option
33
© Paradigm Publishing, Inc. 33 1)This type of relationship is used when you want to break a large table into two smaller tables. a.many-to-many b.many-to-one c.one-to-many d.one-to-one 1)This type of relationship is used when you want to break a large table into two smaller tables. a.many-to-many b.many-to-one c.one-to-many d.one-to-one 3)To display a subdatasheet, click this preceding the record. a.view indicator b.expand indicator c.collapse indicator d.remove indicator 3)To display a subdatasheet, click this preceding the record. a.view indicator b.expand indicator c.collapse indicator d.remove indicator 2)Add tables to the Relationships window at this dialog box. a.Show Table b.Show Relationships c.Edit Relationships d.Edit Table 2)Add tables to the Relationships window at this dialog box. a.Show Table b.Show Relationships c.Edit Relationships d.Edit Table 4)To display all subdatasheets, start by clicking this button in the Home tab. a.View b.Expand c.Display d.More 4)To display all subdatasheets, start by clicking this button in the Home tab. a.View b.Expand c.Display d.More Next Question Next Slide Answer
34
© Paradigm Publishing, Inc. 34 Creating Relationships between Tables Define a primary key in a table Create a one-to-many relationship Specify referential integrity Print, edit, and delete relationships Create a one-to-one relationship View and edit a subdatasheet Summary of Presentation Concepts
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.