SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.

Slides:



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

Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
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.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 1 1 Microsoft Access 2003 Tutorial 1 – Introduction To Microsoft Access 2003.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Define Table Relationships—1 of 3 One of the most powerful features of a relational database management system, such as Access, is its ability to define.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
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,
Microsoft Access Lesson 3
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.
Microsoft Access – Tutorial 3
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Tutorial 8 Advanced Queries. Notes Switch to new database! Tutorial.08 folder Only Session 8.1 and 8.2.
Access Tutorial 2 Building a Database and Defining Table Relationships
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
® 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 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.
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
Using Microsoft Access 56:150 Information System Design.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Microsoft Access 2013 ®® Tutorial 9 Using Action Queries and Advanced Table Relationships.
McGraw-Hill/Irwin © The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T6 Basic Skills Using Access.
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
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.
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.
Access Tutorial 2 Building a Database and Defining Table Relationships
Objectives Create an action query to create a table
Microsoft Access 2003 Illustrated Complete
Microsoft Office Access 2003
Tutorial 3 – Querying a Database
Microsoft Office Access 2003
Microsoft Office Access 2003
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:

SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith

Objectives  Questions from Last Week  Action Queries  Table Relationships

Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships

Create action queries  You can create other types of queries that make changes to the data in the underlying table(s).  Action queries can: Create a new table (make-table query) Add records to a table (append query) Delete records from a table (delete query) Update the data in a table (update query)

Action query considerations  When creating a query that actually makes changes to your database, take extreme care that you do not create a query that performs unintended actions.  It is a good idea to create your action query first as a select query.  You can then view the results and determine if these are the records you want to alter.  When you are sure the query will be applied to the records you really want, you can then run the query as an action query.

Use make-table and append query queries  To change a select query to a Make Table query, choose Make-Table Query from the Query Type button's list.  This will open the Make Table dialog box, in which you will specify the name of the new table.  To change a select query to an append query, choose Append Query from the Query type button's list.  In the Append Query dialog box, you will specify to which table you want to append records.  The Append To row will be displayed in the design grid indicating the fields that the query will append to the table.

The Make Table dialog box

The query window for an append query

Creating a Delete Query  A delete query is used to delete records you no longer need in your database.  To create a delete query, first create and run a select query in Design View, selecting the items you wish to delete.  If the select query displays only the records you wish to delete, click the list arrow for the Query Type button in design view and then click Delete Query.  Run the query to delete the records you previously selected.

Delete Query Dialog Box

Creating an Update Query  Create a select query with the necessary fields and selection criteria and click the Run button to preview the results.  Click the list arrow for the Query Type button and select Update Query.  Type the update values for the fields you need to update in their Update To text boxes.  Click the Run button on the Query Design toolbar.  Click the Yes button to confirm updating the records.

Update Query Dialog Box

One-to-Many Relationships  A one-to-many (1:M) exists between two tables when each record in the primary table matches zero, one, or many records in the related table, and when each record in the related table matches at most one record in the primary table.  Referential integrity is the rule that requires each nonnull foreign key value to match a primary key value

A one-to-many relationship

A query datasheet for a one-to-many relationship

Define many-to-many and one-to- one relationships between tables  A many-to-many relationship exists between tables when the tables involved have multiple matches in each of the tables. For example, if you have a table containing student data and another table containing course data, you could say that this is a (M:N) relationship because a student can take many courses and a course can have many students  Whenever there is a many-to-many relationship, you must provide a third table that will “link” the two tables together in a one-to-many relationship.  You can also have a one-to-one relationship between tables, which means that there is exactly one record in the primary table that matches exactly one record in the related table.

A many-to-many relationship

A query datasheet for a many-to-many relationship

The Relationships Window

View and create indexes to tables  When you establish a primary key for a table, you are actually creating an index for the table.  An index is a list that relates field values to the records that contain those field values.  The index makes it faster to search for records and to sort the records in a table.  You can view existing indexes in table design view by clicking on the Indexes button on the Table Design toolbar.

How indexing works  You can create an index on any field in a table. However, each index actually is a new file and takes up space  When records are entered into a table they are assigned an internal record number in the order they were entered.  The index created a different ordering of the records but keeps track of the number originally assigned to the record.

An illustration of an index

The Indexes window

Join a table using a self-join  There are three types of joins: The inner join selects records from two tables only when the records have the same value in the common field that links the tables. A left outer join selects all records from the first, or left, table and only those records from the second, or right, table that have matching common field values. A right outer join selects all records from the second, or right, table and only those records from the first, or left, table that have matching common field values.  A self-join can be either an inner or outer join and is used to join a table to itself.

An example of an inner join

An example of a left outer join

An example of a right outer join

An example of a self-join