Upload
feipo469
View
105
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Notes from College course homework for networking class, tests bank is included.
Citation preview
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-1
David M. Kroenke’s
Appendix A:
Introduction to
Microsoft Access
Part One
Database Processing:Fundamentals, Design, and Implementation
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-2
Example Database DesignThree tables: STUDENT, CLASS and GRADE
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-3
MS Access – Basic Data Types
• Text• Memo• Number
– Byte– Integer– Long Integer– Single– Double– Decimal
• Date/Time• Currency• Yes/No• AutoNumber
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-4
MS Access – Table Keys
• Each table has a key• A key is one or more columns that identify a row:
– StudentNumber in STUDENT– ClassNumber in CLASS
• Keys composed of more than one column are called composite keys:– (StudentNumber, ClassNumber) in GRADE
• See Chapter Three for a complete discussion of keys.• In this Appendix, the following keys are relevant:
– Primary key – The key used to identify rows in a table– Foreign key – The key used to link to another table– Surrogate key – A short, numeric key added to the table as an
ideal identifier when other fields don’t work as well
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-5
Example Database Design
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-6
MS Access - Relationships
• StudentNumber in GRADE creates a relationship to StudentNumber in STUDENT
• ClassNumber in GRADE creates a relationship to ClassNumber in CLASS
• StudentNumber in GRADE and ClassNumber in GRADE are examples of foreign keys
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-7
Creating a Database
UseCreate a new file…
to create a database
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-8
Creating a Table
UseCreate table in Design View
to create a table
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-9
Creating Columns (Fields)
(1) Type in FieldName
(2) SelectData Type
(3) Add a Description
(4) Modify Data Type properties on General Page
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-10
The STUDENT Table Definition
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-11
The CLASS and GRADE Tables
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-12
Adding Data to Tables
• We can add data to a table by:– Using the datasheet view, or– Using a form
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-13
Adding Data to Tables:Using the Datasheet View
Type data into each cell.This is just like using a
spreadsheet.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-14
David M. Kroenke’s Database Processing
Fundamentals, Design, and Implementation
(10th Edition)
End of Presentation:Appendix A Part One
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-15
David M. Kroenke’s
Appendix A:
Introduction to
Microsoft Access
Part Two
Database Processing:Fundamentals, Design, and Implementation
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-16
Adding Data to Tables:Using a Form
UseCreate form by using wizard
to create a form
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-17
Adding Data to Tables:Using a Form
Select fields from Available Fields by using the Select
Field [>] and Select All Fields [>>] buttons
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-18
Adding Data to Tables:Using a Form
Type data into each field on the form
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-19
Creating Queries
UseCreate query in Design view
to create a query
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-20
Creating Queries
Add tables to the query
Select fields from table fields by “drag and
drop” – the * symbol means “all fields”
Add criteria to determine which rows
are selected by the query
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-21
Creating Queries
To run the query, use the menu command Query | Run or the button
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-22
Viewing MS Access SQL
To see the SQL version of the query, use the menu command View | SQL or the SQL button on the View drop-down list:
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-23
David M. Kroenke’s Database Processing
Fundamentals, Design, and Implementation
(10th Edition)
End of Presentation:Appendix A Part Two
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-24
David M. Kroenke’s
Appendix A:
Introduction to
Microsoft Access
Part Three
Database Processing:Fundamentals, Design, and Implementation
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-25
Creating Relationships
To create relationships between tables, use the menu commandTools | Relationships. When the Show Table dialog box appears, select the tables STUDENT, CLASS and GRADE. MS Access places the tables in the Relationships window.
Drag StudentNumber from STUDENT to
StudentNumber in GRADE.Check Enforce Referential
Integrity.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-26
Creating Relationships:The Competed Relationships
The symbols“1” and “”indicate a
One-to-Many [1:N] relationship
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-27
Creating Multitable Forms
(1) As before, use Create form using wizard: Choose CLASS as the first Table/Query and add all available fields
(2) Select the GRADE Table
(3) Add only the fields StudentNumber and Grade using the [>] button
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-28
Creating Multitable Forms:The Final Form
Fields from CLASS
Fields from GRADE
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-29
Creating a Report
(1) Click Reports in the Objects list.
(2) Use Create report by using wizard.
(3) Select:
CLASS: All fields
GRADE: StudentNumber, Grade
STUDENT: StudentName
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-30
Creating a Report:The Finished Report
(4) Click the wizard’s Finish button, and the finished report appears:
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall
A-31
David M. Kroenke’s Database Processing
Fundamentals, Design, and Implementation
(10th Edition)
End of Presentation:Appendix A Part Three