Download presentation
Presentation is loading. Please wait.
Published byZoe Jarvis Modified over 11 years ago
1
Information Systems Technology Ross Malaga B Copyright © 2005 Prentice Hall, Inc. B-1 WORKING WITH DATABASES
2
Copyright © 2005 Prentice Hall, Inc. B-2 LEARNING GOALS Design a database. Build the database tables using Microsoft Access ®.Microsoft Access Establish relationships between tables. Design and use forms. Perform basic database queries. Use Microsoft Word ® to perform a mail merge with the database.Microsoft Word
3
Copyright © 2005 Prentice Hall, Inc. B-3 Database Design Prior to building a database, we must consider the overall logical design. overall logical design The design includes: –The database tablestables Each attribute in a table The primary key for the tableprimary key –Relationships between tables Foreign keys in any tablesForeign keys –An Entity-Relationship diagram provides a graphical representation of the logical database design.
4
Copyright © 2005 Prentice Hall, Inc. B-4 Building a Table Open Microsoft Access ® –Click on the blank Access database button –Give database a name –Create table in design view For each attribute that is to be in the table, you enter: –The attribute/column name –The data type »If the first attribute is to be the primary key (e.g. Person_Number) then choose Auto Number as data type Assign the primary key –Save the table File/Save menu item Save icon on the tool bar looks like floppy disk –Repeat create table steps for other tables
5
Copyright © 2005 Prentice Hall, Inc. B-5 Establishing Relationships Use the Tools|Relationships menu items to open the Relationships window Select the tables for which you wish to establish relationships Define the relationship –Point to the foreign key field in the relationship –Hold down the left mouse button and drag the foreign key field to the primary key in the relationship Determine Join type Check option to Enforce Referential IntegrityReferential Integrity
6
Copyright © 2005 Prentice Hall, Inc. B-6
7
Copyright © 2005 Prentice Hall, Inc. B-7
8
Copyright © 2005 Prentice Hall, Inc. B-8 Designing Forms Select the Forms object. Choose the form wizard. –Select the table for this form. –Add fields you want on the form. –Pick a form layout. –Pick a style (Standard is probably best). –Enter a descriptive title for the form.
9
Copyright © 2005 Prentice Hall, Inc. B-9 Combining Forms Use a Subform if you wish to enter data into two or more tables at the same time. The Subform tool puts a table containing a foreign key on the same form with the table to which the foreign key links.
10
Copyright © 2005 Prentice Hall, Inc. B-10 Queries Click on the Query object. Choose the Create by Query Wizard option. Choose the table(s) to be in the report. Move any/all fields to the report. Click Next. Choose Modify the Query Design to allow entry of query criteria.
11
Copyright © 2005 Prentice Hall, Inc. B-11
12
Copyright © 2005 Prentice Hall, Inc. B-12 Query Criteria Open an existing query in Design view. For each attribute included in the selection criteria –Enter the value/condition for including records in the query output –=VA under the attribute for state selects only the records that are for people from Virginia –=32504 under the attribute for zip_code selects only the records that are for people from that zip code To run the query, double click on the query name.
13
Copyright © 2005 Prentice Hall, Inc. B-13
14
Copyright © 2005 Prentice Hall, Inc. B-14 Mail Merge Open Microsoft Word and activate the Mail Merge Wizard –Tools|Mail Merge
15
Copyright © 2005 Prentice Hall, Inc. B-15
16
Copyright © 2005 Prentice Hall, Inc. B-16 Mail Merge (continued) Choose or create a main document. –Some standard document options are provided. –You may create main document in the active window or create linked documents (very advanced topic). Choose data source. –Open Data Source. –Change type to Microsoft Access. –Find your database table. –Click Open.
17
Copyright © 2005 Prentice Hall, Inc. B-17 Mail Merge (continued) Edit the Main Document. –This is where you will create the document prototype. –Create the format for your main document. –Use the Insert Merge Field option to insert a field from the database into the document prototype. –Repeat for all other fields from the database. –Type other text in document prototype just as if you were doing a regular Word document. Merge the data from your database with the document prototype. –Merge to Printer to print documents.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.