powerpoint presentation to accompany go! with microsoft ® access 2007 volume 1 chapter 4
DESCRIPTION
PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter 4 Designing and Building a Relational Database. Objectives. Customize Table Fields Structure Data Input Validate Data Input Create Indexes and Change Sort Order Create Relationships between Tables - PowerPoint PPT PresentationTRANSCRIPT
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
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 4
Customize Table Fields
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 6
Structure Data Input
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 8
Structure Data Input
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 9
Structure Data Input
• Figure 4.13
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.
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 13
Validate Data Input
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 15
Validate Data Input
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 16
Validate Data Input
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 19
Create Indexes and Change Sort Order
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 22
Create Relationships between Tables
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 24
Create Relationships between Tables
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 27
Create Relationships between Tables
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 30
Create Relationships between Tables
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
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
with Microsoft Access 2007 Volume 1 © 2008 Pearson Prentice Hall 33
Create Forms and Reports with Related Tables
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