Presentation is loading. Please wait.

Presentation is loading. Please wait.

McGraw-Hill/Irwin ©2005 The McGraw-Hill Companies, All rights reserved ©2005 The McGraw-Hill Companies, All rights reserved McGraw-Hill/Irwin.

Similar presentations


Presentation on theme: "McGraw-Hill/Irwin ©2005 The McGraw-Hill Companies, All rights reserved ©2005 The McGraw-Hill Companies, All rights reserved McGraw-Hill/Irwin."— Presentation transcript:

1 McGraw-Hill/Irwin ©2005 The McGraw-Hill Companies, All rights reserved ©2005 The McGraw-Hill Companies, All rights reserved McGraw-Hill/Irwin

2 McGraw-Hill/Irwin ©2005 The McGraw-Hill Companies, All rights reserved Extended Learning Module J IMPLEMENTING A DATABASE WITH MICROSOFT ACCESS

3 J-3 STUDENT LEARNING OUTCOMES 1.Identify the steps necessary to implement the structure of a relational database using the data definition language provided by Microsoft Access

4 J-4 STUDENT LEARNING OUTCOMES 2.Demonstrate how to use the data manipulation subsystem in Access to enter and change information in a database and how to query that information

5 J-5 STUDENT LEARNING OUTCOMES 3.Explain the use of the application generation subsystem in Access to create reports and data entry screens

6 J-6 INTRODUCTION In Figure J.1 on the following 3 slides that follow the next, we’ve recreated the correct database structure from Extended Learning Module C Revisit Module C if you need a refresher

7 J-7 INTRODUCTION 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

8 J-8 INTRODUCTION

9 J-9 INTRODUCTION

10 J-10 INTRODUCTION

11 J-11 Creating the Solomon Enterprises Database Data dictionary - contains the logical structure for the information To create the Solomon Enterprise database perform the following steps: 1.Start Microsoft Access 2.Select Blank Database (or select File and New) and then Blank Database on the right side of the screen 3.Select a folder for the database and enter a file name (we’ll use Solomon Enterprises.mdb) 4.Click on Create

12 J-12 Creating the Structure of the Solomon Enterprises Database

13 J-13 Creating the Structure of the Solomon Enterprises Database To create a relation (table) in Design view: – make sure the Tables tab is selected and then double-click on Create table in Design view –Enter a name, data type, and description (the last is optional) for each field in a given relation –Save that structure and repeat the process until you’ve created the structure for each relation in your database

14 J-14 Creating the Structure of the Solomon Enterprises Database

15 J-15 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

16 J-16 Creating the Raw Material Relation

17 J-17 Creating the Concrete Type Relation

18 J-18 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

19 J-19 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

20 J-20 Creating the Bill of Material Relation

21 J-21 DEFINING RELATIONSHIPS WITHIN THE 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)

22 J-22 Primary and Foreign Key Logical Ties

23 J-23 Defining the Relationships between the Relations To create relationships –Click on the Relationships button in the button bar –Make each relation appear on the palette by highlighting each relation name and clicking on Add –Then click on the Close button

24 J-24 Defining the Relationships between the Relations

25 J-25 Defining the Relationships between the Relations

26 J-26 ENTERING INFORMATION INTO THE SOLOMON DATABASE To enter information, you simply highlight the desired relation and click on Open

27 J-27 Entering Information into the Supplier Relation

28 J-28 Entering Information into the Supplier Relation To enter information, highlight the appropriate relation and click on Open

29 J-29 Entering Information into the Supplier Relation The datasheet view looks like a spreadsheet When you close the relation, the information is automatically saved

30 J-30 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 guards against bad information Integrity contraints – rules that help ensure the quality of the information

31 J-31 Enforcing Referential Integrity

32 J-32 Changing the Structure of a Relation

33 J-33 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

34 J-34 Creating a Simple Query Using the Raw Material Relation

35 J-35 Creating a Simple Query Using the Raw Material Relation

36 J-36 Creating a Simple Query with a Condition Our criteria The result

37 J-37 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

38 J-38 Steps to Create an Advanced Query 1.Select the Queries tab 2.Double-click on Create query in Design view

39 J-39 Steps to Create an Advanced Query 3.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

40 J-40 Steps to Create an Advanced Query 4.Drag and drop the fields that you want from the appropriate relation into the QBE grid in the order that you want

41 J-41 Steps to Create an Advanced Query

42 J-42 Steps to Create an Advanced Query

43 J-43 Steps to Create an Advanced Query 5.Click on the exclamation point (Run) in the button bar to see the results of the query

44 J-44 The Results of the Advanced Query

45 J-45 GENERATING A SIMPLE REPORT 1. Select the Reports tab 2. Double-click on Create report by using wizard 3. Choose tables and/or queries: Lets you choose which table/query you want 4. Choose fields: Lets you choose the fields you want

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

47 J-47 Style and Header of Report 8.Style: Allows you to choose from among predefined report styles (we chose the default) 9.Report header: Allows us to enter a title for the report.

48 J-48 Choose Table/Query and Fields Select Reports tab and click Create report by using wizard Highlight the desired fields and click on >

49 J-49 Grouping, Sorting, Layout, Style and Title

50 J-50 Final Report

51 J-51 GENERATING A 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

52 J-52 Steps for Creating a Report with Grouping, Sorting and Totals 1. Select the Reports tab 2. Double click Create report by using wizard 3. Choose tables/queries: Query: Supply Chain Query 4. Choose fields: Select all fields by clicking on the double greater-than sign (>>)

53 J-53 Specify Table/Query and Fields

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

55 J-55 Steps for Grouping Information

56 J-56 Step for Sorting Information We chose to sort in descending order by Raw Material ID

57 J-57 Totaling Information in Report 8.Totaling: The sorting screen also has a Summary Options button –Within Summary Options you can choose what type of summary you want

58 J-58 Totaling Information in Report

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

60 J-60 Formatting the Report

61 J-61 Final Report Place holder for Figure J.21 Doesn’t make sense – title is final report yet asking for Figure J.21. Finale report is last screen in Figure J.20, which is never displayed

62 J-62 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

63 J-63 Refining the Report

64 J-64 Adjusting the Page Header

65 J-65 Adjusting the Concrete Type Header

66 J-66 Adjusting the Detail Section

67 J-67 Adjusting the Concrete Type Footer

68 J-68 The Completed Report

69 J-69 CREATING A DATA INPUT FORM 1. Click on Forms and then on Create form by using wizard 2. Choose Table: Order 3. Select all the fields of the Order table

70 J-70 Choose Table/Query and Fields

71 J-71 Choose Layout, Style, and Title 4. You can choose a layout for your input form 5. This screen allows you to choose a style 6. Enter a title for the input Form and click Finish

72 J-72 Choose Layout and Style

73 J-73 Choose Title for Input Form

74 J-74 Final Input Form

75 J-75 CAN YOU… 1.Identify the steps necessary to implement the structure of a relational database using the data definition language provided by Microsoft Access

76 J-76 CAN YOU… 2.Demonstrate how to use the data manipulation subsystem in Access to enter and change information in a database and how to query that information

77 J-77 CAN YOU… 3.Explain the use of the application generation subsystem in Access to create reports and data entry screens

78 McGraw-Hill/Irwin ©2005 The McGraw-Hill Companies, All rights reserved Extended Learning Module J End of Extended Learning Module J


Download ppt "McGraw-Hill/Irwin ©2005 The McGraw-Hill Companies, All rights reserved ©2005 The McGraw-Hill Companies, All rights reserved McGraw-Hill/Irwin."

Similar presentations


Ads by Google