Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.
-
Upload
justina-holt -
Category
Documents
-
view
216 -
download
0
Transcript of Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.
![Page 1: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/1.jpg)
Microsoft Access 2013Design and Implement Powerful
Relational Databases
Chapter 6
![Page 2: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/2.jpg)
Chapter Overview
Database Relationships
– Referential Integrity
– Cascade Update and Delete
Subforms
Helpful Access Utilities
![Page 3: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/3.jpg)
Database Relationships
Tables should be related on primary and foreign keys with similar data and compatible data types.
Set relationships BEFORE entering data in the tables.
Click Database Tools Ribbon, click Relationships button
![Page 4: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/4.jpg)
Relationships Window
![Page 5: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/5.jpg)
Compatible Data Types
Primary Key Foreign Key
Text 1---∞ __________ Numeric 1---∞ __________ Date 1---∞ __________ Autonumber 1---∞ __________
![Page 6: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/6.jpg)
Errors in Relationships
Caused by one of three things:
1) Primary and/or foreign keys aren’t set properly in the table design
2) Data already exists in table(s) that violates referential integrity
3) Data types of related fields are incompatible or incorrect
![Page 7: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/7.jpg)
Relationship Options
Referential Integrity - Ensures that related records in a database are consistent. Generally a good idea to enforce this option. When enforced,
relationship line indicates 1 and ∞.
Cascade Update & Cascade Delete
![Page 8: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/8.jpg)
Relationships Example
![Page 9: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/9.jpg)
Subforms
A form within a form Displays data on one form from
related tables Can have subforms within subforms
(nested) and multiple subforms on a
single form
![Page 10: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/10.jpg)
Subforms
![Page 11: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/11.jpg)
Subforms Example
![Page 12: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/12.jpg)
Access Utilities
Compact & Repair Database – shrinks size of database. Access database files NEVER decrease in size unless compacted. May need to do this before copying a database to a floppy disk or emailing a database file.
Click Office Button, Manage, Compact and Repair Database
![Page 13: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/13.jpg)
Get External Data
Can be used to import data or link existing database tables.
ODBC link allows you to connect to non-Access databases such as Oracle.
![Page 14: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/14.jpg)
Quick Review
Which is the appropriate pairing for setting relationships?
a. Text PK – Hyperlink FKb. Autonumber FK – Numeric PKc. Date PK – Text FKd. None of the above
![Page 15: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/15.jpg)
Quick Review
A 1---∞ relationship exists between Physicians and Patients. Which is True?
a. Physician ID will appear in the Patients table
b. Patient ID will appear in the Physicians table
c. Both (a) or (b)d. Neither (a) or (b)
![Page 16: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/16.jpg)
Quick Review
Which of the following will delete the relationship between tables?
a. Click the join line connecting the two tables and press the Del key
b. Double click the join line
c. Click the join field and press Del
d. All of the above
![Page 17: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/17.jpg)
Quick Review
Every table in an Access databasea. Must be related to every other
tableb. Must have one or more foreign
keysc. Both (a) and (b)d. Neither (a) nor (b)
![Page 18: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/18.jpg)
Quick Review
Which of the following is true?a. A main form may contain
multiple subformsb. A subform may contain another
subformc. Both (a) and (b)d. Neither (a) nor (b)
![Page 19: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/19.jpg)
Quick Review
True / FalseWhen creating relationships
between tables in Access, you must relate the tables on fields with the same data types.
![Page 20: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/20.jpg)
Quick Review
True / FalseA many-to-many relationship is
implemented by a pair of one-to-many relationships.
![Page 21: Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.](https://reader036.fdocuments.us/reader036/viewer/2022062422/56649f135503460f94c27dbc/html5/thumbnails/21.jpg)
Homework 4
Chapter 6 Guided Exercise Chapter 6 Applied Exercise