RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 

Slides:



Advertisements
Similar presentations
Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri.
Advertisements

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.
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
Relational Model Stores data as tables –Each column contains values about the same attribute –Each column has a distinct name –Each row contains values.
Methodology Logical Database Design for the Relational Model
Mapping of N:M Relationships PERSON-ID TITLE PERSON-NAME DATE-OF-BIRTH PERSON-ID PROJECT-ID HOURS-SPENT PROJECT-ID END-DATE START-DATE E-R Diagram PERSON.
Querying a Database Microsoft Office Access 2003.
SQL DDL constraints Restrictions on the columns and tables 1SQL DDL Constraints.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Computer Science & Engineering 2111 Introduction to Database Management Systems Relationships and Database Creation 1 CSE 2111 Introduction to Database.
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:
Chapter 6 The Relational Database Model: Additional Concepts
Chapter 3 Maintaining a Database
Microsoft Access Lesson 3
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.
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.
Database Relationships. Types of Relationships One to one – Person to Driver’s License, Country to President, Person to Social Security Number (in theory)
© 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.
Relationships and Advanced Query Concepts Using Multiple Tables Please use speaker notes for additional information!
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 1 Workshop 2 Tables, Keys, and Relationships Series Editor Amy Kinser.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
Database Design. Referential Integrity : data in a table that links to data in another table must always work in such a way that following the link will.
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.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
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.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
1 Chapter 17 Methodology - Local Logical Database Design.
1 CS 430 Database Theory Winter 2005 Lecture 15: How to Convert an ER Model to Relations.
Build a database III: Build relationships for a new Access database Overview: You can relate This course teaches you how to build relationships between.
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Chapter 9 Constraints. Chapter Objectives  Explain the purpose of constraints in a table  Distinguish among PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK,
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
ER- Relational Mapping (Based on Chapter 9 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Fundamental of Database Systems
Tables & Relationships
Chapter 5 Database Design
COP 4540 Database Management
Objectives Query for top values Create a parameter query
CSIS 115 Database Design and Applications for Business
COS 346 Day 8.
Relational Queries (query 12) Display vendor contact info (contact person and phone number) for inventory products (relationship query) Query: Inventory.
CS122 Using Relational Databases and SQL
Entities Things about which you need to store data. One entity for each different thing. At least two attributes At least two occurrences Not a property.
Guide to Modeling Keys to E-R diagrams.
CS122 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS122 Using Relational Databases and SQL
Guide to Modeling Keys to E-R diagrams.
CS122 Using Relational Databases and SQL
Relationships While we are on the subject of Relationships, let’s take a quick look at them.
Presentation transcript:

RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE  1:1or1:MorM:N

HOW TO IMPLEMENT?  (1:1) THE PRIMARY KEY OF ONE TABLE IS INCLUDED AS AN ATTRIBUTE TO THE OTHER TABLE.  THIS IS KNOWN AS FOREIGN KEY.

HOW TO IMPLEMENT?  (1:M) THE PRIMARY KEY OF THE 1 SIDE TABLE IS ADDED AS AN ATTRIBUTE TO THE MANY SIDE TABLE.  THIS IS KNOWN AS FOREIGN KEY.

HOW TO IMPLEMENT?  (M:N) CREATE A NEW TABLE.  PRIMARY KEY OF THE NEW TABLE IS THE COMBINATION OF THE PRIMARY KEY OF THE M-SIDE AND N-SIDE TABLE.  WE CAN ADD NEW ATTRIBUTE FOR THE RELATION  THEY ARE KNOWN AS FOREIGN KEYS.

HOW TO CREATE?  FROM THE MAIN MENU BAR SELECT o TOOLS ► RELATIONSHIP  THEN ADD THE TABLES  THEN DRAG PKs TO FKs

HOW TO CREATE?

REFERENTIAL INTEGRITY

 USING KEY AND DATA CONSTRAINTS WE MAINTAIN THE INTEGRITY OF DATA IN A FIELD OR IN A TABLE.  USING REFERENTIAL CONSTRAINT WE MAINTAIN INTEGRITY AMONG TABLES IN A DATABASE.  WE DEFINE THEM DURING CREATION OF RELATIONSHIP.

TYPES OF REFERENTIAL INTEGRITY CONSTRAINTS (RI)  RESTRICTED DELETES  RESTRICTED INSERTS  CASCADE DELETES  CASCADING UPDATES

RESTRICTED DELETES  MEANS A PARENT RECORD CANNOT BE DELETED IF CHILD RECORD EXISTS.  WE MUST UNCHECK THE Cascade Delete Related Records CHECK BOX IN THE Edit Relationship DIALOG BOX.

RESTRICTED DELETES

RESTRICTED INSERTS  MEANS A CHILD RECORD CANNOT REFERENCE A NON EXISTENT PARENT RECORD.  IF A CHILD RECORD REFERENCE A RECORD THAT IS NOT IN THE PARENT TABLE THIS IS KNOWN AS ORPHAN RECORDS.  THE DBMS AUTOMATICALLY IMPLEMENTS THIS CONSTRAINT.

CASCADING DELETES  MEANS IF A PARENT RECORD IS DELETED ALL RELATED CHILD RECORDS ARE ALSO DELETED AUTOMATICALLY.  WE SHOULD CHECK THE Cascade Delete Related Records CHECK BOX IN THE Edit Relationship DIALOG BOX.

CASCADING DELETES

CASCADING UPDATES  MEANS IF THE PRIMARY KEY OF THE PARENT IS CHANGED, THE FOREIGN KEY IN ALL RELATED CHILD RECORDS IS UPDATED AUTOMATICALLY.  WE SHOULD CHECK THE Cascade Update Related Records CHECK BOX IN THE Edit Relationship DIALOG BOX.