Microsoft Access 2013 ®® Tutorial 9 Using Action Queries and Advanced Table Relationships
XP Objectives Session 9.1 – Create an action query to create a table – Create action queries to append, delete, and update data Session 9.2 – 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 20132
XP Using Action Queries and Advanced Table Relationships Case - Chatham Community Health Services Enhancing User Interaction with the Health Database User wants to enhance the database by creating some advanced queries and integrating more tables into the database Tasks include: Creating Action Queries Creating relationships between database tables Defining M:N and 1:1 Relationships Between Tables Joining Tables Using Indexes for table fields Viewing existing indexes New Perspectives on Microsoft Access 20133
XP Using Action Queries and Advanced Table Relationships (Cont.) New Perspectives on Microsoft Access 20134
XP New Perspectives on Microsoft Access Using Action Queries and Advanced Table Relationships (Cont.)
XP New Perspectives on Microsoft Access Using Action Queries and Advanced Table Relationships (Cont.)
XP New Perspectives on Microsoft Access Using Action Queries and Advanced Table Relationships (Cont.)
XP Action Queries New Perspectives on Microsoft Access Action Query – A query that adds, changes, or deletes multiple table records at a time – Make Table Query Creates a new table by copying records from one or more existing tables – Append Query Adds records from existing tables or queries to the end of another table – Delete Query Deletes a group of records matching the criteria you specify from one or more tables
XP Action Queries (Cont.) New Perspectives on Microsoft Access History Table – Contains data that is no longer needed for current processing but that you might need to reference in the future
XP Action Queries (Cont.) New Perspectives on Microsoft Access Creating a Make Table Query
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access Creating an Append Query
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access Creating a Delete Query
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access Creating an Update Query
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Action Queries (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Many-to-Many Relationships – Abbreviated M:N – When you have a many-to-many relationship between two tables, you must create a third table, known as a relationship table, and form one-to many relationships between the two original primary tables and the relationship table – When you join tables that have a many-to-many relationship, you can extract data from them as if they were one larger table Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP One-to-One Relationships – Abbreviated 1:1 – Each record in the first table matches at most one record in the second table, and each record in the second table matches at most one record in the first table – An entity subtype is a table whose primary key is a foreign key to a second table and whose fields are additional fields for the second table Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Defining M:N and 1:1 Relationships Between Tables Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Joining Tables – Inner Join 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 – Outer Join 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 Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access – Self Join A table that is joined with itself Can be either an inner or outer join – Imagine a situation where there are multiple supervisors, and each of the supervisors also has a supervisor – Separate tables for supervisors would be very confusing – The supervisors are also employees, and thus the EmployeeID for a supervisor is entered in the SupervisorID field – This is a case where a self-join would be used
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP – Creating a Self Join Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access – Using Indexes for Table Fields An index is a list that relates field values to the records that contain those field values Access automatically creates and maintains an index for a table’s primary key
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access Viewing Existing Indexes
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access Creating an Index
XP Relationships Between Database Tables (Cont.) New Perspectives on Microsoft Access