PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4
description
Transcript of PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4
![Page 1: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/1.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 1
PowerPoint Presentation to AccompanyGO! with Microsoft® Access 2007 Volume 1
Chapter 4Designing and Building a Relational Database
![Page 2: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/2.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 2
Objectives
• Customize Table Fields• Structure Data Input• Validate Data Input• Create Indexes and Change Sort Order• Create Relationships between Tables• Create Forms and Reports with Related
Tables
![Page 3: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/3.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 3
Customize Table Fields
• Data types determine type of data stored in a field
• Field properties ensure data is consistent and correct
• Caption properties make entry more user friendly
• Ten different data types• Attachment data type used to store pictures,
Office files, and small programs
![Page 4: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/4.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 4
Customize Table Fields
![Page 5: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/5.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 5
Structure Data Input• Lookup data type or lookup field
retrieves values • Lookup Wizard fills in correct field
property to do a lookup• Combo box shows arrow that lists items• List box displays values without arrow• Row source property specifies table,
query, or typed list• Multiple column lookup field enables
more than one column of data to be seen
![Page 6: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/6.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 6
Structure Data Input
![Page 7: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/7.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 7
Structure Data Input• Input property mask controls the structure of
entered data• Input Mask Wizard: Prebuilt input masks for
common formats• Input masks can be tested, modified, and
created manually• Placeholder characters can be replaced
during data entry• Literal characters are characters that cannot
be replaced
![Page 8: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/8.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 8
Structure Data Input
![Page 9: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/9.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 9
Structure Data Input
• Figure 4.13
![Page 10: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/10.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 10
Structure Data InputSpecial meanings are assigned to placeholder characters
Character Meaning Character Meaning
0 A single digit is required. & Any character is required (spaces are characters).
9 A single digit is optional. C Any character is optional.
L A single letter is required. PASSWORD Displays them as asterisks(*).
? A single letter is optional. \ The following character will be a literal character.
A A single letter or digit is required.
> All characters that follow change to uppercase.
a A single letter or digit is optional. < All characters that follow change to lowercase.
![Page 11: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/11.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 11
Validate Data Input
• Access provides tools to ensure valid data is placed in tables
• Fields can be identified as required• Rules can be written to ensure specified
criteria are met• By default, only field that must be
entered is the primary key
![Page 12: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/12.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 12
Validate Data Input
• If field’s Required property is set to Yes, that field must contain an entry
• Allow Zero Length property determines if an entry can have zero characters
• Set to No the field is required
![Page 13: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/13.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 13
Validate Data Input
![Page 14: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/14.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 14
Validate Data Input• Validation Rule property method to ensure
validity• Validation Text property provides a custom
message• Data integrity: Data is entered and stored
according to its intended use• Default values save time• Data typically entered into forms• Test validation system using forms
![Page 15: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/15.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 15
Validate Data Input
![Page 16: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/16.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 16
Validate Data Input
![Page 17: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/17.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 17
Create Indexes and Change Sort Order
• Data is often searched and sorted• Indexes speed searching and sorting• Indexed property creates a second
table• Indexes can slow data entry table
updates• By default tables sorted on primary key
![Page 18: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/18.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 18
Create Indexes and Change Sort Order
• Databases can be sorted on other fields• These fields should be indexed
– Yes (Duplicates OK) creates an index that allows duplicates
– Yes (No Duplicates) builds an index where every value is unique
• Indexes can be built to ensure a field’s value is unique
![Page 19: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/19.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 19
Create Indexes and Change Sort Order
![Page 20: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/20.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 20
Create Relationships between Tables
• Many programs can store data in tables• True power of using a database is its
ability to relate tables• Relationships are an association
between two tables using a common field
• Relationships can be created several ways
![Page 21: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/21.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 21
Create Relationships between Tables
• Referential integrity refers to rules used to preserve valid data
• Related fields do not need to have same name, just same data type
• One-to-one relationship: Common field used to join tables
• Used in limited situations
![Page 22: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/22.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 22
Create Relationships between Tables
![Page 23: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/23.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 23
Create Relationships between Tables
• Subdatasheet is datasheet nested within another
• Displays the records joined to the first table through a relationship
• Created in Design view
![Page 24: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/24.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 24
Create Relationships between Tables
![Page 25: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/25.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 25
Create Relationships between Tables
• One-to-many relationship is an association between two tables in which the primary key of each record in the primary table corresponds to the value in the matching field of many records in the related table
• Common field is typically the first table’s primary key
![Page 26: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/26.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 26
Create Relationships between Tables
• In second table the related field is called the foreign key
• Foreign keys are always on the “many” side of the relationship
![Page 27: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/27.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 27
Create Relationships between Tables
![Page 28: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/28.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 28
Create Relationships between Tables
• Referential Integrity are the rules that you follow to preserve the defined relationships between tables when you add, update, or delete records
• Cascading update changes related occurrences of data if table is changed
• Cascading delete deletes all matching records in the second table when a record is deleted from the first
![Page 29: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/29.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 29
Create Relationships between Tables
• In many-to-many relationships records in either table can match many records in the other table
• One-to-many relationship is the most common
![Page 30: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/30.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 30
Create Relationships between Tables
![Page 31: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/31.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 31
Create Forms and Reports with Related Tables
• Queries, forms, and reports can access data from related tables in a relational database
• Relationship report shows the current layout of the Relationship window
• Data can be queried from more than one table
![Page 32: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/32.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 32
Create Forms and Reports with Related Tables
• A single form can be used to enter data from more than one table
• Subforms are forms inserted within another form
• They are often used for tables in one-to-many relationships
• Subforms display data from a related table
![Page 33: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/33.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 33
Create Forms and Reports with Related Tables
![Page 34: PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4](https://reader035.fdocuments.in/reader035/viewer/2022062501/56815ea2550346895dcd3026/html5/thumbnails/34.jpg)
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 34
Objectives
• Customize Table Fields• Structure Data Input• Validate Data Input• Create Indexes and Change Sort Order• Create Relationships between Tables• Create Forms and Reports with Related
Tables