Microsoft Access 2 Database Creation and Management.

Slides:



Advertisements
Similar presentations
Microsoft Access 2 Database Creation and Management.
Advertisements

Microsoft Access.
1 After completing this lesson, you will be able to: Create a database. Create a table using the Table Wizard. Create and modify a table in Design view.
Benchmark Series Microsoft Access 2010 Level 1
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Database Creation and Management
Chapter 5 Multitable Forms
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Access Lesson 2 Creating a Database
Chapter 1 Databases and Database Objects: An Introduction
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
Creating And Maintaining A Database. 2 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of.
Querying a Database Microsoft Office Access 2003.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 3 Maintaining a Database Using the Design and Update Features of Access.
Database Creation and Management
Chapter 3 Maintaining a Database
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Access Tutorial 2 Building a Database and Defining Table Relationships
Chapter 1 Databases and Database Objects: An Introduction
Chapter 6 Advanced Report Techniques
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Microsoft Access – Tutorial 2 Designing Databases In this tutorial, we will create a new database create a new table import tables from an existing database.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Microsoft Access 2000 Presentation 2 Creating Databases Part I (Creating Tables)
XP New Perspectives on Microsoft Access 2002 Tutorial 21 Microsoft Access Tutorial 2 – Creating And Maintaining A Database.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
Key Applications Module Lesson 21 — Access Essentials
® Microsoft Access 2010 Tutorial 2 Building a Database and Defining Table Relationships.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T6: Basic Skills and Tools Using Access 2010 Business Driven Technology.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 10 Administering a Database System.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
McGraw-Hill/Irwin © The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T6 Basic Skills Using Access.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Microsoft Access 4 Database Creation and Management.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
Work with Tables and Database Records Lesson 3 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Access.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
1 Access Lesson 1 Understanding Access Fundamentals Microsoft Office 2010 Fundamentals Story / Walls.
Access Tutorial 2 Building a Database and Defining Table Relationships
Maintaining a Database Using the Design and Update Features of Access
and Defining Table Relationships
Tutorial 3 – Querying a Database
Chapter 1 Databases and Database Objects: An Introduction
Microsoft Office Access 2003
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 2 Building a Database and Defining Table Relationships
Presentation transcript:

Microsoft Access 2 Database Creation and Management

Creating a Order table Barbara wants to track information about each order placed by each restaurant customer. This information includes the order’s billing date and invoice amount. Barbara asks you to create a second table in the Restaurant database, named Order, in which to store the order data.

Create a new table To create a new table, click the New button in the Database window. The New Table dialog box then opens. You can design your own table or use one of the Wizards to assist you in designing the table. Choose an option, then click OK. Read from this to slide #17

The database Design View window

Access data (field) type Make certain the field type you select matches the data to be held in that field.

Access data (field) type (con’t) Additional Access field types.

Defining a field in Design View Enter a field name that describes the purpose of the field. Click the Data Type list arrow to see a list of types to select from. A field description is optional, but it is a good idea to supply one. Other field properties can be set in the Properties window.

Choosing a primary key Click a row selector for the field you want to use as the primary key, and then click the Primary Key button on the toolbar. After clicking the Primary Key button, a key symbol appears in the row selector to indicate the key field.

Add records to a table using Datasheet View Once the table has been created, you can then add records to the table using Datasheet View. As you enter records, they will be placed in the order in which you enter them. However, when you close the table and open it again, the records will be ordered according to the primary key order. The navigation bar at the bottom of the Datasheet view will indicate how many records are in the table and what the current record is. You can move through the fields in the table by pressing the Tab key. Once your cursor is moved off a record, that record is automatically saved on your disk.

Datasheet View with 2 records added Two records have been inserted, and the insertion point is positioned for the third. The navigation bar shows the current record indicator is in the third of three records.

Moving a field in Design View 1. Click the row selector for the field you want to move to select the entire row. 2. Place the pointer over the row selector, and press and hold down the left mouse button. 3. When the pointer changes to the move pointer, drag the field to its new location.

Adding a new field in Design View 1. Right-click the row selector for the field you want to insert the new field in front of--StartDate in this figure. 2. Select Insert Rows from the shortcut menu, and a new, blank row will be inserted before the row you selected, as shown below. 3. Enter the information for the new field.

Change field properties You can make additional modifications to the structure of a table by changing the properties of the table's fields. For example, if you have a field that represents a currency value but you do not want to display dollar signs, you could change the format to a standard format In the Design View, you will find a list of all formats available to you. You can make a selection from the list of options Each data type has a separate set of options available in the Field Properties portion of the Table Design Window Field properties are changed in the Design View window.

Changing field properties in Design View When you click a row selector for a field you want to modify, the properties window shows the current properties for that field. Clicking the list arrow for the Format property displays a list of formats that can be selected.

Delete and change records Once records have been added to a table, they can be deleted or modified: In Datasheet view, click the row selector for the record(s) you want to delete and then click the Delete Record button on the toolbar To change or modify a record: Place your cursor on the record and then on the field you want to change You can then edit the field's value as you wish by typing in new data You can switch from navigation mode to editing mode depending on what you want to do at the time. When you are editing a record, you are in editing mode, Otherwise you are in navigation mode Editing mode is indicated by a pencil symbol in the left margin of the datasheet view

An alternate method for deleting a record Records can also be deleted by right-clicking the row selector for the record you want to delete, and then clicking the Delete Record option on the shortcut menu.

Modify a table by deleting, moving, and adding fields The structure of a table can be modified after it has been created. To delete a field, enter Design View, right-click on the field, and then click Delete Rows on the drop down menu. To move a field, (you also do this in Design View) click on the field you want to move, and while holding your mouse button down, move the field to the desired location. To add a field in Design View, right-click the field where you want to insert the new field and then click Insert Rows on the dropdown menu. This is slide #17

Creating a Order table Use Design view (NOT Wizard) Not allow design flexibility Use wizard for the exam will cause problems… Case sensitive NUMBER vs. number Exact match of each name Use tap key to enter data Especially, when you enter data in datasheet view.

Creating the Order table Field NameData TypeDescriptionField Properties OrderNumTextprimary keyField size (3), Required (Yes) CustomerNumTextforeign keyField size (3) BillingDateDate/Time PlacedByTextperson who placed order Field size (25) InvoiceAmtCurrency

Adding Records to a Table Enter data sequentially in Datasheet view Do not jump from field to field Use tap key to enter data OrderNumCustomerNumBillingDatePlacedByInvoiceAm t /15/2001Mike Smith$1, /15/2001Matt Davis$854.00

Modifying a Table From the Order table Delete the PlacedBy field Move the BillingDate field to the end of the table Insert the Paid as a new field between CustomerNum and InvoiceAmt (position) fields data type: Yes/No default value: No (means “unpaid”) Add following data to each filed: 211, 201, paid (mark the check box using space bar), $703.50, 01/15/2001

Practice: Creating a DB Barbara needs a database to track the coffee products offered by Valle Coffee. She asks you to create the database by completing the following: In the initial Microsoft Access dialog box, click the blank Access database option button, and then click OK button. Click the Create button the new database. YOUR LAST NAME DB file name Display the Table window in Design view (if necessary), and then create a table using the table design shown in the next slide.

Practice: Creating a Table Specify ProductCode as the primary key, and then save the table as Product. Add the product records shown in next slide table to the Product table. (Hint: You must type the decimal point when entering the Price field values.) Field NameData TypeDescriptionField Properties ProductCodeTextPrimary KeyField size (4), Required: Yes CoffeeCodeTextForeign KeyField size (4) PriceCurrencyPrice for this product DecafTextD if decaf, Null if regular Field size (1), Default Value: D BackOrderedYes/Noback-ordered from supplier?

Practice: Modifying a Table Add a new field between the CoffeeCode and Price fields, using these properties; Field Name:WeightCode Data Type: Text Description: foreign key Field Size:1 Move the Decaf field so that it appears between the WeightCode and Price fields. ProductCodeCoffeeCodePriceDecafBackOrdered 2316JRUM8.99 Yes 9754HAZL40.00DYes 9309COCO9.99DNo

Practice: Updating a Table Enter these WeightCode values for the three records: A for ProductCode 2316, A for ProductCode 9309, and E for ProductCode Add a record to the Product datasheet with these field values: ProductCode:9729 CoffeeCode: COLS WeightCode:E Decaf:D Price:39.75 BackOrdered:Yes

Primary Key (PK) No “null” value can be allowed. No two records can have the same primary key. A PK can be a composite key Midterm: ONLY single primary key; No composite More than one field can be used as a PK (composite) See the example on the web: “ Composite PK”

Foreign Key A filed that connects one table logically with another table. if B references A, then A must exist. See exception example on the web: “PK as FK” Midterm: No Exception ONLY single PK & FK

Importing External Access Table and Excel Worksheet Barbara also wants you to include the Product and Order Detail tables from the FineFood database in the Restaurant database. Review design view of FineFood DB And she wants you to include the Billing Address Excel worksheet as a Access table in the Restaurant database. Before try to import the excel file, review it first Use Excel column headings for Access table PK: CustomerNum Specify in the description area of Design View that CutomerNum is not only primary key of BillingAddress table but also a foreign key of Customer table.

Access is a relational database Access allows you to form relationships between the tables. That’s why it’s called a relational database The simplest way to create a relationship Look for common fields (identical field names) between the tables. Tables can be joined in three ways; one-to-one, one- to-many, and many-to-many. Midterm: ONLY one-to-many relationship type; import three Excel files…

An example of a one-to-many relationship The Employer table is related to the Position table via the common field EmployerID. The Employer table has one record for EmployerID value The Position table has two records.

A one-to-one relationship A one-to-one relationship exists when one table has one record associated with only one record of another table. As we saw from PK as FK databse Shipping Address table is an related table. Primary table: customer table Primary key is also foreign key

Using referential integrity Referential integrity allows you to maintain the integrity and consistency between related tables. If you choose to enforce referential integrity, you can insure that you will not have records that have no matching record in the primary table. The rules associated with referential integrity specify that when you update or delete a record (PK) in the primary table, a matching record (FK) in the related record must be updated or deleted.

Use cascade update and cascade delete In referential integrity, there are two options. If you choose cascaded updates, making a change in a field that is common to two related tables will cause the update to be made in both tables. If you delete a field that is common to two tables, the deletion will take place in both tables. Enforcing Access Referential integrity Rules Let’s try Referential Integrity Example on the web for better understanding

Selecting the tables for a relationship When all tables are added, click the Close button. To define a relationship, open the Show Table dialog box by clicking the Relationship button on the toolbar. Select each table you want to be in the relationship and click the Add button.

Setting relationship options The Edit Relationships dialog box is where you can determine the type of relationship, and set referential integrity and cascade update/delete options.

The Relationships window You can see the tables, fields, and relationship types for any relationship in the Relationship window. The lines indicate the common fields involved in each relationship. The symbols indicate the type of relationship. The Employer table has two one- to-many relationships--one with the Positions table, and one with the NAICS table.

Creating Relationships Download Restaurant 2 from the web Create relationships using 5 table In terms of creating a relationship between Customer and BillingAddress, start from the Customer table. Enforce both cascade options Primary key of the Order Detail table Combination of OrderNum and ProductCode Otherwise, a duplication of the quantity field in both the Order and Product tables.

Practice : Creating Relationships 1 Create a blank database (use any name you like) And then, import the three Excel Worksheets (Course, Instructor, and Membership) from the class web site into your Access database. Define each imported table’s primary key using information below: Course table: Class_Number Instructor table: Employee_Number Membership table: Member_Number

Practice : Creating Relationships 2 Establish relationship based on common fields. And enforce referential integrity (apply both options) among three imported tables