® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.

Slides:



Advertisements
Similar presentations
Objectives Create an action query to create a table
Advertisements

Microsoft Access.
Concepts of Database Management Seventh Edition
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Access Tutorial 3 Maintaining and Querying a Database
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Access Tutorial 1 Creating a Database
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 1 1 Microsoft Access 2003 Tutorial 1 – Introduction To Microsoft Access 2003.
Access Tutorial 10 Automating Tasks with Macros
Tutorial 1 Creating a Database. Objectives Learn basic database concepts and terms Learn basic database concepts and terms Explore the Microsoft Access.
Chapter 2 Querying a Database
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
Chapter 3 Maintaining a Database
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 1Advanced Tables, Relationships, Queries, and Forms Chapter 3Advanced Query Techniques.
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Access Tutorial 2 Building a Database and Defining Table Relationships
® 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 2010 Tutorial 1 Creating a Database.
® Microsoft Office 2010 Access Tutorial 2 Building a Database and Defining Table Relationships.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 9 – Building Links,
XP New Perspectives on Microsoft Access 2002 Tutorial 21 Microsoft Access Tutorial 2 – Creating And Maintaining 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.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
® Microsoft Access 2010 Tutorial 2 Building a Database and Defining Table Relationships.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
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.
Microsoft Access Intro Class 6 Relationships.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
® Microsoft Office 2013 Access Creating a Database.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Microsoft Access 2013 ®® Tutorial 9 Using Action Queries and Advanced Table Relationships.
Microsoft Access 2013 ®® Tutorial 10 Automating Tasks with Macros.
COMPREHENSIVE Access Tutorial 12 Managing and Securing a Database.
Actions Queries. Understanding Action Queries  Action queries are a way to make corrections to database. They can make an enormous mess of database if.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
You can sort Access data so you can view records in the order you want to view them, and you can filter data so you only see the records you want to see.
Lesson 2: Designing a Database and Creating Tables.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
COMPREHENSIVE Access Tutorial 1 Creating a Database.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Access Tutorial 2 Building a Database and Defining Table Relationships
Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Objectives Create an action query to create a table
Access Creating a Database
Access Creating a Database
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 2 Building a Database and Defining Table Relationships
Tutorial 9 Using Action Queries and Advanced Table Relationships
New Perspectives on Microsoft
Presentation transcript:

® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships

XP Objectives Create an action query to create a table Create action queries to append, delete, and update data Define many-to-many and one-to-one relationships between tables Learn about joining tables Join a table using a self-join View and create indexes for tables New Perspectives on Microsoft Access 20102

XP Action Queries New Perspectives on Microsoft Access 20103

XP Action Queries An action query is a query that adds, changes, or deletes multiple table records at a time – Make-table query – Append query History table – Delete query – Update query New Perspectives on Microsoft Access 20104

XP Creating a Make-Table Query Create a select query with the necessary fields and selection criteria In the Results group on the Design tab, click the Run button to preview the results Switch to Design view to make any necessary changes to the query. When the query is correct, click the Make Table button in the Query Type group on the Design tab New Perspectives on Microsoft Access 20105

XP Creating a Make-Table Query In the Make Table dialog box, type the new table name in the Table Name box. Make sure the Current Database option button is selected to include the new table in the current database; or, click the Another Database option button and enter the database name in the File Name box. Then click the OK button Click the Run button, and then click the Yes button to confirm the creation of the new table New Perspectives on Microsoft Access 20106

XP Creating a Make-Table Query New Perspectives on Microsoft Access 20107

XP Creating an Append Query Create a select query with the necessary fields and selection criteria In the Results group on the Design tab, click the Run button to preview the results Switch to Design view to make any necessary changes to the query. When the query is correct, click the Append button in the Query Type group on the Design tab New Perspectives on Microsoft Access 20108

XP Creating an Append Query In the Append dialog box, select the table name in the Table Name box. Make sure the Current Database option button is selected to include the new table in the current database; or, click the Another Database option button and enter the database name in the File Name box. Then click the OK button. Access replaces the Show row in the design grid with the Append To row Click the Run button, and then click the Yes button to confirm appending the records to the table New Perspectives on Microsoft Access 20109

XP Creating an Append Query New Perspectives on Microsoft Access

XP Creating a Delete Query Create a select query with the necessary fields and selection criteria In the Results group on the Design tab, click the Run button to preview the results Switch to Design view to make any necessary changes to the query. When the query is correct, click the Delete button in the Query Type group on the Design tab. Access replaces the Show and Sort rows in the design grid with the Delete row Click the Run button, and then click the Yes button to confirm deleting the records New Perspectives on Microsoft Access

XP Creating a Delete Query New Perspectives on Microsoft Access

XP Creating an Update Query Create a select query with the necessary fields and selection criteria In the Results group on the Design tab, click the Run button to preview the results Switch to Design view to make any necessary changes to the query. When the query is correct, click the Update button in the Query Type group on the Design tab. Access replaces the Show and Sort rows in the design grid with the Update To row New Perspectives on Microsoft Access

XP Creating an Update Query Type the updated values in the Update To boxes for the fields you want to update Click the Run button, and then click the Yes button to confirm changing the records New Perspectives on Microsoft Access

XP Many-To-Many Relationship New Perspectives on Microsoft Access

XP Relationships Between Database Tables New Perspectives on Microsoft Access

XP Relationships Between Database Tables New Perspectives on Microsoft Access

XP Defining M:N and 1:1 Relationships Between Tables New Perspectives on Microsoft Access Many-to-Many relationship example: – An invoice can represent work performed by many employees, and each employee can work on many invoice projects – When this type of relationship exists, a third table needs to be created to form a one-to-many relationship – between the original primary tables and the new related table

XP Defining M:N Relationships Between Tables New Perspectives on Microsoft Access “A typical example is a school registration site in which classes can have multiple students and students can have multiple classes. In general, many-to-many relationships require a join table (also known as the junction table) that stores keys from tables on both sides of the relationship. In the school example, a join table would store class ID and student ID.”

XP Defining M:N and 1:1 Relationships Between Tables New Perspectives on Microsoft Access

XP Joining Tables An inner join is a join in which the DBMS selects records from two tables only when the records have the same value in the common field that links the tables New Perspectives on Microsoft Access

XP Joining Tables An outer join is a join in which the DBMS selects all records from one table and only those records from a second table that have matching common field values New Perspectives on Microsoft Access

XP Creating a Self-Join Click the Create tab on the Ribbon In the Queries group on the Create tab, click the Query Design button In the Show Table dialog box, double-click the table for the self-join, double-click the table a second time, and then click the Close button Click and drag the primary key field from one field list to the foreign key field in the other field list New Perspectives on Microsoft Access

XP Creating a Self-Join Right-click the join line between the two tables, and then click Join Properties to open the Join Properties dialog box Click the first option button to select an inner join, or click the second option button or the third option button to select an outer join, and then click the OK button Select the fields, specify the selection criteria, select the sort options, and set other properties as appropriate for the query New Perspectives on Microsoft Access

XP Creating a Self-Join New Perspectives on Microsoft Access

XP Creating a Self-Join New Perspectives on Microsoft Access Seff-Join/ Joining a table to itself useful for tables with a self-referencing relationship or when one wants to determine data inconsistencies Use aliases to treat the table as two separate tables SELECT F.customer_num, F.customer_name, S.customer_num, S.customer_name, F.city FROM customer F, customer S WHERE F.city = S.city AND F.customer_num < S.customer_num ORDER BY F.customer_num, S.customer_num;

XP Creating a Self-Join New Perspectives on Microsoft Access Using a Self-Join on a Primary Key A self-join can involve the primary key of a table Occurs when a foreign key in the table is the same as the primary key of the table For example, in an Employee table, EmployeeID may be the primary key and SupervisorID could be another column, which represents the employee number of the employee’s manager Because the manager is also an employee, SupervisorID is a foreign key whose value will match the value of the primary key of the same table. (in Query design view, link EmployeeID to SupervisorID)

XP Viewing a Table’s Existing Indexes Open the table in Design view To view an index for a single field, click the field, and then view the Indexed property in the Field Properties pane To view all the indexes for a table or to view an index consisting of multiple fields, click the Indexes button in the Show/Hide group on the Design tab New Perspectives on Microsoft Access

XP Viewing a Table’s Existing Indexes New Perspectives on Microsoft Access

XP Creating an Index Open the table in Design view To create an index for a single field, click the field, and then set the Indexed property in the Field Properties pane To create an index consisting of multiple fields, click the Indexes button in the Show/Hide group on the Design tab, enter a name for the index in the Index Name box, select the fields in the Field Name box, and then set other properties as necessary for the index New Perspectives on Microsoft Access

XP Creating an Index New Perspectives on Microsoft Access