Presentation is loading. Please wait.

Presentation is loading. Please wait.

McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Extended Learning Module J (Office 2007 Version) Implementing.

Similar presentations


Presentation on theme: "McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Extended Learning Module J (Office 2007 Version) Implementing."— Presentation transcript:

1 McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Extended Learning Module J (Office 2007 Version) Implementing a Database with Microsoft Access

2 Mod J Web-2 SOLOMON DATABASE  The steps to creating a database are 1. Define entity classes and primary keys 2. Define relationships among the entity classes 3. Define fields for each relation (file) 4. Use a data definition language to create the database, which is the focus of this Module

3 Mod J Web-3 SOLOMON DATABASE  In Figure J.1 (p. 2) on the following 3 slides, we’ve recreated the correct database structure from Extended Learning Module C  Revisit Module C if you need a refresher

4 Mod J Web-4 SOLOMON DATABASE

5 Mod J Web-5 SOLOMON DATABASE

6 Mod J Web-6 SOLOMON DATABASE

7 Mod J Web-7 Creating Solomon’s Database  Data dictionary - contains the logical structure for the information  To create the Solomon Enterprise database: 1. Start Microsoft Access 2. Click on Blank Database in the upper left corner of the screen 3. Enter Solomon Enterprises.mdb as the database name 4. Click on Create

8 Mod J Web-8 Creating Solomon’s Database Click on Blank Database Enter a database name and click on Create

9 Mod J Web-9 Creating Solomon’s Database  Our recommendation: Create a relation (table) in Design view:  Must switch from Datasheet View to Design View  Click on View in the upper left corner and then Design View  Enter a table name  Use the Design View to enter the specifications for the table

10 Mod J Web-10 Creating Solomon’s Database To switch to Design View, click on View and then Design View This is Design View – our recommendation for creating the tables in a database

11 Mod J Web-11 Creating the Raw Material Relation  Enter the four fields of the Raw Material relation  Raw Material ID  Raw Material Name  QOH  Supplier ID  Click on the Raw Material ID row and then the key button to designate Raw Material ID as the primary key

12 Mod J Web-12 Creating the Raw Material Relation Primary key identifier and the Primary key button Integrity constraints for Raw Material ID

13 Mod J Web-13 Creating the Concrete Type Relation

14 Mod J Web-14 Creating the Bill of Material Relation  We created (in Extended Learning Module C) the Bill of Material relation to eliminate the many-to-many relationship between the Concrete Type and Raw Material relations

15 Mod J Web-15 Creating the Bill of Material Relation  The Bill of Material relation has a primary key composed of two fields (composite primary key):  Concrete Type  Raw Material ID  Composite primary key - consists of the primary key fields from the two intersecting relations

16 Mod J Web-16 Creating the Bill of Material Relation Composite primary key

17 Mod J Web-17 DEFINING RELATIONSHIPS WITHIN SOLOMON’S DATABASE  The final structural task is to define how all the relations relate to each other  That is, link primary and foreign keys  Foreign key - a primary key of one file (relation) that appears in another file (relation)

18 Mod J Web-18 Primary and Foreign Key Logical Ties

19 Mod J Web-19 Defining Relationships between Relations  To create relationships  Click on Database Tools in the menu area and then click on the Relationships button  Make each relation appear on the palette by highlighting each relation name and clicking on Add  Then click on the Close button

20 Mod J Web-20 Defining Relationships between Relations Relationship palette Select tables and click on Add

21 Mod J Web-21 Defining Relationships between Relations

22 Mod J Web-22 ENTERING INFORMATION INTO SOLOMON’S DATABASE  To enter information, you simply double- click on the appropriate relation name Supplier relation structure

23 Mod J Web-23 Entering Information

24 Mod J Web-24 Referential Integrity  Referential integrity ensures consistency. For example, that you don’t put a non-existent Supplier ID into the Raw Material relation  The relationships we set up for referential integrity guard against bad information  Integrity constraints – rules that help ensure the quality of the information

25 Mod J Web-25 Enforcing Referential Integrity

26 Mod J Web-26 Change the Structure of a Relation Click on View and then Design View and make the necessary changes

27 Mod J Web-27 CREATING A SIMPLE QUERY USING ONE RELATION  Query-by-example (QBE) tool - helps you graphically design the answer to a question  Suppose we wanted to see a list of raw materials that shows  Raw Material Name  Supplier ID

28 Mod J Web-28 Creating a Simple Query Using the Raw Material Relation First, click on Create and then Query Design Second, select the table, click on Add, and then close the box.

29 Mod J Web-29 Creating a Simple Query Using the Raw Material Relation The result of the query Drag and drop the appropriate field names and then click on the exclamation point (Run).

30 Mod J Web-30 Creating a Simple Query with a Condition Set the condition here

31 Mod J Web-31 CREATING AN ADVANCED QUERY USING MORE THAN ONE RELATION  Suppose we want a query that shows  All order numbers  Date of orders  Where the goods were delivered  The contact person  The truck involved in each delivery  The truck driver in each delivery

32 Mod J Web-32 Steps to Create an Advanced Query 1. Click on Create in the menu area and then Query Design 2. In the Show Table dialog box  Select and Add the relation names  Close the Show Table dialog box  Tables linked appear are joined by lines with  1 beside the table with the primary key  The infinity sign by the table with the foreign key

33 Mod J Web-33 Steps to Create an Advanced Query 3. Drag and drop the fields that you want from the appropriate relation into the QBE grid in the order that you want 4. Click on the exclamation point (Run) in the button bar to see the results of the query

34 Mod J Web-34 Steps to Create an Advanced Query

35 Mod J Web-35 Steps to Create an Advanced Query

36 Mod J Web-36 Steps to Create an Advanced Query

37 Mod J Web-37 GENERATING A SIMPLE REPORT 1. Click on Create in the menu area and then the Report Wizard button 2. Choose tables and/or queries: Lets you choose which table/query you want 3. Choose fields: Lets you choose the fields you want

38 Mod J Web-38 Grouping, Sorting, Layout of Report 4. Grouping: Lets you specify grouping of information (we chose the default) 5. Sorting: Allows you to specify sorting (we chose the default) 6. Layout and orientation: Allows you to select layout and page orientation (we chose the default)

39 Mod J Web-39 Style and Header of Report 7. Style: Allows you to choose from among predefined report styles (we chose the default) 8. Report header: Allows us to enter a title for the report. 9. The Report: Shows all customers and phone numbers.

40 Mod J Web-40 Choose Table/Query and Fields 1. Start to create a report 2. Choose tables and/or queries

41 Mod J Web-41 Choose Table/Query and Fields 3. Choose fields 4. Grouping

42 Mod J Web-42 Grouping, Sorting, Layout, Style, and Title 5. Sorting 6. Layout and orientation

43 Mod J Web-43 Grouping, Sorting, Layout, Style, and Title 7. Style 8. Report Header

44 Mod J Web-44 Grouping, Sorting, Layout, Style, and Title

45 Mod J Web-45 REPORT WITH GROUPING, SORTING, AND TOTALS  Say we want to create the Supply Chain Management report from Extended Learning Module C  First, create a query  Then, put the query into the report generator

46 Mod J Web-46 Steps for Creating a Report with Grouping, Sorting, and Totals 1. Click on Create in the menu area and click on the Report Wizard button 2. Choose tables/queries: Query: Supply Chain Query 3. Choose fields: Select all fields by clicking on the double greater-than sign (>>)

47 Mod J Web-47 Specify Table/Query Fields

48 Mod J Web-48 Grouping and Sorting Information 4. Top-level grouping: Allows you to choose ordering. Since we created a query, Access has defaulted to the first field 5. Further grouping: Lets you specify groups within the top grouping of Concrete Type, but we don’t want any further grouping 6. Sorting: Next we have a chance to sort our information

49 Mod J Web-49 Steps for Grouping Information

50 Mod J Web-50 Steps for Sorting Information

51 Mod J Web-51 Totaling Information in a Report 7. Totaling: The sorting screen also has a Summary Options button  Within Summary Options you can choose what type of summary you want

52 Mod J Web-52 Totaling Information in a Report

53 Mod J Web-53 Formatting the Report 8. Overall structure of report: Allows you to choose the layout and orientation 9. Style of report: Allows you to choose a style 10. Report heading: Allows you to enter the title that will appear on the report, then click on Finish

54 Mod J Web-54 Formatting the Report

55 Mod J Web-55 The Report 11. The Report: Shows the information from the wizard steps

56 Mod J Web-56 Refining the Report  Steps to adjust the report to make it aesthetically pleasing  Open the report in Design View with the triangle button  Adjust the boxes to the desired size  Delete unwanted entries

57 Mod J Web-57 Refining the Report Click on Design View to see the report in design format

58 Mod J Web-58 Adjusting the Page Header

59 Mod J Web-59 Adjusting the Concrete Type Header

60 Mod J Web-60 Adjusting the Detail Section

61 Mod J Web-61 Adjusting the Concrete Type Footer

62 Mod J Web-62 The Completed Report

63 Mod J Web-63 CREATING A DATA INPUT FORM 1. Select the Order table 2. Click on Create and then Form

64 Mod J Web-64 Choose Table/Query

65 Mod J Web-65 Final Input Form


Download ppt "McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Extended Learning Module J (Office 2007 Version) Implementing."

Similar presentations


Ads by Google