Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relationships in Microsoft Access The Access Workbench: Section Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.

Similar presentations


Presentation on theme: "Relationships in Microsoft Access The Access Workbench: Section Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition."— Presentation transcript:

1 Relationships in Microsoft Access The Access Workbench: Section Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition

2 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-2 Section Objectives Understand 1:1 relationships in Access Understand N:M relationships in Access

3 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-3 Relationships in Access All the tables we’ve used so far in Access have had 1:N relationships How are 1:1 and N:M relationships managed in Access?

4 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-4 N:M Relationships in Access Pure N:M relationships occur in data modeling When a data model is transformed into a database design, an N:M relationship is broken down into two 1:N relationships Each 1:N relationship is between a table resulting from one of the original entities in the N:M relationship and a new intersection table. Since databases are built in Access from the database design, Access only deals with the resulting 1:N relationships—as far as Access is concerned there are no N:M relationships!

5 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-5 1:1 Relationships in Access: The 1:1 Relationship Between SALESPERSON and VEHICLE

6 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-6 Database Column Characteristics: The VEHICLE Table Column NameTypeKeyRequiredRemarks InventoryIDAutoNumberPrimary KeyYesSurrogate Key ModelText (25)NoYes VINText (35)NoYes VEHICLE

7 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-7 VEHICLE Data InventoryIDModelVIN [AutoNumber]HiStandardG06HS123400001 [AutoNumber]HiStandardG06HS123400002 [AutoNumber]HiStandardG06HS123400003 [AutoNumber]HiLuxuryG06HL234500001 [AutoNumber]HiLuxuryG06HL234500002 [AutoNumber]HiLuxuryG06HL234500003 [AutoNumber]SUHiG06HU345600001 [AutoNumber]SUHiG06HU345600002 [AutoNumber]SUHiG06HU345600003 [AutoNumber]HiElectraG06HE456700001

8 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-8 SALESPERSON.InventoryID Column Characteristics Column NameTypeKeyRequiredRemarks InventoryIDIntForeign KeyNo SALESPERSON

9 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-9 SALESPERSON.InventoryID Data NickNameLastNameFirstName...InventoryID TinaSmithTIna...4 Big BillJonesWilliam...5 BillyJonesBill...7

10 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-10 1:1 Relationships in Access: A 1:N Relationship is Created by Default The VEHICLE to SALEPERSON relationship The relationship is 1:N—this is not the 1:1 relationship we wanted!

11 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-11 1:1 Relationships in Access: Setting the Indexed Property Value in the SALESPERSON Table Select the InventoryID field Set the Indexed property to Yes (No Duplicates)

12 KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall AW-5-12 1:1 Relationships in Access: The Correct 1:1 VEHICLE to SALESPERSON Relationship The VEHICLE to SALEPERSON relationship The relationship is now the correct 1:1 relationship we wanted!

13 Relationships in Microsoft Access End of Presentation on The Access Workbench: Section Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition


Download ppt "Relationships in Microsoft Access The Access Workbench: Section Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition."

Similar presentations


Ads by Google