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.

Slides:



Advertisements
Similar presentations
Table Relationships RDBM. Prof. Leighton2 Establishing Table Relationships RDBMS allow us to establish relationships among tables Have a primary key in.
Advertisements

Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri.
Microsoft Access.
Microsoft Office 2013 ®® Access Tutorial 2 Building a Database and Defining Table Relationships.
Tutorial 3 Queries and Table Relationships
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
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.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
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.
QUERYING A DATABASE By: Dr.Ennis-Cole. OBJECTIVES: Learn how to use the Query window in Design view Create, run and Save queries Define a relationship.
Computer Science & Engineering 2111 Introduction to Database Management Systems Relationships and Database Creation 1 CSE 2111 Introduction to Database.
Database Relationships Objective 5.01 Understand database tables used in business.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Microsoft Access Lesson 3
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Microsoft Access – Tutorial 3
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 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,
Office Management Tools II Ms Saima Gul.  When you create your tables, you should assign each table a primary key—one or more fields whose contents are.
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.
Relationships and Advanced Query Concepts Using Multiple Tables Please use speaker notes for additional information!
® 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.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
Microsoft Access Intro Class 6 Relationships.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
IBS 520 Introduction to Internet Technology Database Fundamentals Week 4.
Access Chapter 1: Intro to Access Objectives Navigate among objects in Access database Difference between working in storage and memory Good database file.
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.
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
AOIT Database Design Unit 3, Lesson 9 Data Integrity Copyright © 2009–2011 National Academy Foundation. All rights reserved.
Access Tutorial 2 Building a Database and Defining Table Relationships
New Perspectives on Microsoft Access 2016
Tables & Relationships
Microsoft Access – Tutorial 3
and Defining Table Relationships
CIS 155 Table Relationship
Microsoft Office Illustrated Fundamentals
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
Relationships While we are on the subject of Relationships, let’s take a quick look at them.
Presentation transcript:

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 relationships between tables. You use a common field, which is a field that appears in two tables, to relate one table to another. The process of relating tables is often called performing a join. When you join tables that have a common field, you can extract data from them as if they were one larger table.

Define Table Relationships—2 of 3 For example, you can join the Client and Contract tables using Client# as the common field. common field

Define Table Relationships—3 of 3 Then you can use a query, form, or report to extract selected data from both tables, even though the data is contained in two separate tables. The joining of records in the query below is based on the common field of Client#. In the query results shown below, the Client Name column is from the Client table, and the other columns are from the Contract table. fields from Contract tablefield from Client table

The Client and Contract tables have a one-to-many relationship. A one-to-many relationship exists between two tables when one record in the first table matches zero, one, or many records in the second table, and when one record in the second table matches exactly one record in the first table. One-to-Many Relationships—1 of 3

Access refers to the two tables that form a relationship as the primary table and the related table. The primary table is the “one” table in a one-to-many relationship; the Client table is a primary table because there is only one client for each contract. The related table is the “many” table; the Contract table is a related table because there can be many contracts for each client. One-to-Many Relationships—2 of 3

Because related data is stored in two tables, inconsistencies between the tables can occur. Consider the following scenarios: Travis adds a contract to the Contract table for a client that does not exist. The data is inconsistent, and the contract record is considered to be an orphaned record. Travis changes a client number in the Client table without changing that same client number for related records in the Contract table. These contract records are now orphaned records. Travis deletes a client record because the client is no longer an AdZ client. The data is again inconsistent, if contract records still exist for that deleted client. One-to-Many Relationships—3 of 3

You can avoid data inconsistencies by specifying referential integrity between tables when you define their relationships. Referential integrity is a set of rules that Access enforces to maintain consistency between related tables when you update data in a database. Referential Integrity—1 of 2

Specifically, the referential integrity rules are as follows: When you add a record to a related table, a matching record must already exist in the primary table. If you attempt to change the value of the primary key in the primary table, Access prevents this change if matching records exist in the related table. However, if you choose the cascade updates option, Access permits the change in value to the primary key and changes the appropriate foreign key values in the related table. If you attempt to delete a record in the primary table, Access prevents the deletion if matching records exist in the related table. However, if you choose the cascade deletes option, Access deletes the record in the primary table and also deletes all records in related tables that have matching foreign key values. Referential Integrity—2 of 2

Define a Relationship Between Two Tables When two tables have a common field, you define a relationship between them in the Relationships window, which you open by clicking the Relationships button on the toolbar. The Relationships window illustrates the relationships among a database’s tables. In this window you can view or change existing relationships, define new relationships between tables, and rearrange the placement of tables in the window.