Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.

Similar presentations


Presentation on theme: "1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating."— Presentation transcript:

1 1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating Databases with Microsoft Access Raymond Frost – John Day – Craig Van Slyke

2 2 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Microsoft Access Data Types Exhibit 8-1: Data Types Available in Microsoft Access

3 3 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Sky_Member Database Design Exhibit 8-2: Design and Data for the Skydiving Club Member Database

4 4 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Database in Access Specify database file Create table Create columns by –Entering column name –Selecting data type –Specifying field size, when applicable Indicate primary key Enter data

5 5 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Microsoft Access Interface Exhibit 8-3: Creating a Database in Access Use this option to create a new database.

6 6 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Specifying the Database File Exhibit 8-4: Specifying the Database File The.mdb extension is the standard file type for Microsoft Access databases. Name the file “sky_member”

7 7 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Database Window Exhibit 8-5: The Database Window The database window provides access to all the types of objects that can be part of a database. Use this option to create a new table.

8 8 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Access Database Objects Tables: basic storage units in the database Queries: saved sets of instructions for retrieving database data Forms: interactive screens that allow you to work with database data Reports: display and print reports based on database data Pages: Web pages published from Access that allow you to view and manipulate data stored in the database Macros: lists of Access functions that can be used to automate tasks Modules: stored procedures written in Visual Basic used to automate tasks

9 9 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Table in Design View Exhibit 8-6: Creating a Table in Design View Type a name for the field, then select a data type. For text fields, enter the size.

10 10 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Number Data Types Exhibit 8-7: Creating a Column with a Number Data Type For Number fields, select a number type rather than entering a size. On the next page, we will look at a Validation Rule.

11 11 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Validation Rules Exhibit 8-8: Creating a Validation Rule A Validation Rule is a condition that will be applied to the data entered in the field. Here, a rule is being created for the Equip field that requires the user to enter either Y or N. Any other data will be rejected.

12 12 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Completed Validation Rule Exhibit 8-9:The SKY_MEMBER Table with a Validation Rule This is what the table design looks like when the Validation Rule is completed. After the equip field is defined, a skill field is also entered. It will have a validation rule limiting input to B, I, and A.

13 13 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Primary Key Exhibit 8-10: Specifying the Primary Key A primary key is specified by selecting a field and then clicking the primary key button on the toolbar. Note the key symbol added in the box in front of the field name.

14 14 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Entering Data Exhibit 8-11: The Datasheet View of the SKY_MEMBER table Once the table is created and saved, click on the datasheet icon to show the table in datasheet view. Data can now be entered in the cells. There is always a blank row at the bottom where a new row can be added.

15 15 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Using the Validation Rule Exhibit 8-12: The Error Displayed When Violating a Validation Rule When entering data in a column that includes a validation rule, Access will display an error message if you try to enter data that violates the rule.

16 16 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Completed Table Exhibit 8-13: The Completed SKY_MEMBER Table

17 17 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Query Exhibit 8-14: Creating a Query A query can be used to retrieve and display data in a table. Queries can be created from the database window.

18 18 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Query in Design View Exhibit 8-15: Designing the Query When the sky_member table is selected, it will be displayed in the design view. Select the “sky_member.*” item in the drop-down list to display all the fields in the table.

19 19 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Query Display Exhibit 8-16: The Results of the Query When the Query, Run menu option is used to execute the query, the results will be displayed as shown above

20 20 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Arcade Database Design Exhibit 8-17: The Design for the Arcade Database

21 21 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Arcade Database Data Exhibit 8-17: The Design for the Arcade Database

22 22 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Member Table Exhibit 8-18: The Design for the MEMBER Table This is the completed design for the MEMBER table.

23 23 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Visit Table Exhibit 8-19: The Design for the VISIT Table This is the completed design for the VISIT table.

24 24 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Relationship Exhibit 8-20: The Show Table Dialog Box When a database contains two tables, the tables can be linked by creating a relationship. Use the Tools, Relationships menu option to create a relationship. This will display the list of tables shown to the right. Use the Add button to add each table to the Relationships View.

25 25 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Relationships View Exhibit 8-21: The Relationships View The Relationships View can be used to link the two tables: click and drag the member$email column in the Visit table onto the email column in the Member table to indicate that they match. This will display the Edit Relationships dialog box on the next slide.

26 26 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Editing the Relationship Exhibit 8-22: The Edit Relationships Dialog Box Check the Enforce Referential Integrity box. This will ensure that values entered in the member$email foreign key field match values in the email primary key field in the Member table.

27 27 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 The Completed Relationship Exhibit 8-23: The Completed Relationship The infinity symbol indicates that the relationship is one-to-many.

28 28 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Referential Integrity Exhibit 8-24: The Error Generated When Violating Referential Integrity When a value is entered in the member$email column that does not match a value in the email column of the member table, this error message will be displayed.

29 29 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Displaying Related Rows Exhibit 8-25: Displaying Related Rows on the Datasheet The Datasheet View of a table linked to a second table includes the additional option of displaying the related records. Click on the plus (+) at the beginning of the row.

30 30 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Exhibit 8-26: The Design of the Enrollment Database Enrollment Database Design

31 31 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Enrollment Database Data Exhibit 8-26: The Design of the Enrollment Database

32 32 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Creating a Concatenated Key Exhibit 8-27: Creating a Concatenated Key To create a concatenated key, simply highlight both fields in the design view and click on the Primary Key button. The key symbol should be displayed in front of both fields.

33 33 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Enrollment Database Relationships Exhibit 8-28: Relationships for the Enroll Database In the Relationships View, add all the tables and drag each foreign key to its corresponding primary key.

34 34 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Hospital Database Design Exhibit 8-29: Design and Data for the Hospital Database

35 35 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Hospital Database Data Exhibit 8-29: Design and Data for the Hospital Database

36 36 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Acme Database Design Exhibit 8-30: Design and Data for the Acme Database

37 37 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Acme Database Data Exhibit 8-30: Design and Data for the Acme Database

38 38 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Amazon Database Design Exhibit 8-31: Design and Data for the Amazon Database

39 39 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 Amazon Database Data Exhibit 8-31: Design and Data for the Amazon Database


Download ppt "1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating."

Similar presentations


Ads by Google