1 CHƯƠNG 4 Creating Relational Databases. 2 1. Understanding Table Relationships Example: This database tracks customers and their orders in two separate.

Slides:



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

Table Relationships RDBM. Prof. Leighton2 Establishing Table Relationships RDBMS allow us to establish relationships among tables Have a primary key in.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 2Creating Relationships between Tables.
Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri.
Microsoft Office Illustrated Fundamentals Unit K: Working with Data.
Microsoft Access.
MS-Access XP Lesson 2. Input Mask Property 1.Field : Phone No Data Type : Number Input Mask : Character 0 represent a single digit and phone.
ISP 121 Access Normalization and Relationships. Normalization Say we’re operating a pet day-care and we need to keep information on our pets/customers.
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.
Querying a Database Microsoft Office Access 2003.
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.
Lesson 32: Designing a Relational Database. 2 Lesson Objectives After studying this lesson, you will be able to:  Identify and apply principles for good.
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.
Microsoft ® Office Access ® 2007 Training Build a database III: Build relationships for a new Access database ICT Staff Development presents:
Database Relationships Objective 5.01 Understand database tables used in business.
Tutorial 1 Creating a Database. Objectives Learn basic database concepts and terms Learn basic database concepts and terms Explore the Microsoft Access.
Chapter 3 Maintaining a Database
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.
Primary & Foreign Keys. PK & FK 1.Primary key is required 2.The PK must be unique 3.If the primary key from one table is related to a field in another.
Microsoft Access – Tutorial 3
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Introducing Access Lesson 1. Objectives Start Access and explore the Database window Explore database objects Enter, edit, and delete records in a datasheet.
Chapter 6 Advanced Report Techniques
Viewing Tip: While viewing this presentation in your browser, select Browse, Full Screen. Then, when you want to pause the show, Right Click and select.
® 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.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
Course ILT Access basics Unit objectives Define database and database-related terminology, and plan a database Start Access and open, create, view, and.
© 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.
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.
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.
® Microsoft Office 2013 Access Creating a Database.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.
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 After completing this lesson, you will be able to: Change the format of a table. Sort records in a table. Find records in a table Use filters with a.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Build a database III: Build relationships for a new Access database Overview: You can relate This course teaches you how to build relationships between.
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.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
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.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank 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.
® 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.
Microsoft Access 2016 Design and Implement Powerful Relational Databases Chapter 6.
Objectives Create an action query to create a table
CIS 155 Table Relationship
Microsoft Office Illustrated Fundamentals
Design and Implement Powerful Relational Databases Chapter 6
Microsoft Office Access 2003
Tutorial 3 – Querying a Database
Microsoft Office Access 2003
Relational Queries (query 12) Display vendor contact info (contact person and phone number) for inventory products (relationship query) Query: Inventory.
Tutorial 9 Using Action Queries and Advanced Table Relationships
Relationships While we are on the subject of Relationships, let’s take a quick look at them.
Presentation transcript:

1 CHƯƠNG 4 Creating Relational Databases

2 1. Understanding Table Relationships Example: This database tracks customers and their orders in two separate but related tables.

3 1. Understanding Table Relationships A relational database contains multiple tables that are related through matching fields. Relational databases require lots of planning ahead. Before you attempt to create your database you walk through the following steps: –Determine the Purpose of the Database –Write Down the Fields You Need –Organize and Group Related Fields into Separate Tables –Identify and Add the Fields Common to Each Table –Sketch a Diagram of Your Databas

4 2. Creating Relationships Between Tables Click the Relationships button on the toolbar, The Relationships window appears. If the Show Table dialog box doesn't appear when you open the Relationships window, click the Show Table button on the toolbar. Select the tables you want and click add  Close

5 2. Creating Relationships Between Tables Click the related field in the first table and drag it to the related field in the second table.

6 2. Creating Relationships Between Tables Specify any referential integrity and/or join type options (optional). Click create to create the relationship.

7 3. Enforcing Referential Integrity Referential integrity keeps records in related fields valid and accurate. Referential integrity ensures that you don't accidentally change or delete related data in one table but not in the other.

8 3. Enforcing Referential Integrity You can only use referential integrity when all of the following conditions are met: –One of the linked fields is a primary key. –The related fields are the same data type and size. –Both tables are in the same Access database.

9 3. Enforcing Referential Integrity To enforce referential integrity: –Check the enforce referential integrity box. –If you want changes to the primary field of the primary table copied to the related field in the related table, check the cascade update related fields box. –If you want access to automatically delete orphan records in the related table, check the cascade delete related records box Click ok.

10 4. Testing Referential Integrity & Printing and Deleting Table Relationships You can't add a record to a related table unless a matching record already exists in the primary table. You can't change the value of a primary key in the primary table if matching records exist in the related table (unless you select the ). You can't delete a record from a primary table if matching records exist in a related table (unless you select the Cascade Delete Related Records option).

11 4. Testing Referential Integrity & Printing and Deleting Table Relationships To print the relationships window: –In the database window, click the relationships button on the toolbar. –Select file print relationships from the menu. –Modify the report that appears in print preview, if necessary, and then click the print button on the toolbar. To delete a table relationship: –Open the relationshipswindow. –Click the join line that connects the tables and press delete. –Click yes to confirm the deletion.

12 5. Understanding Relationship Types When you link two tables together, they form one of three possible relationships Types of Relationships RelationshipDescription Each record in a table relates to one record in another table. This is the simplest type of relationship, but it doesn't occur very often because it's usually easier to store such information in one table instead of two. Example: Each customer has one credit report.

13 5. Understanding Relationship Types Each record in a table relates to one or more records in another table. This is the most common type of relationship. Example: Each customer has one or more invoices. One or more records in a table relate to one or more records in another table. Many-to-many relationships are very confusing and thus aren't used very often. To create a many-to-many relationship, you usually need a third intermediate table that contains the primary keys from each of the two tables in the relationship. Such an intermediate table is called a junction table.