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.

Slides:



Advertisements
Similar presentations
Designing Tables in Microsoft Access By Ed Lance.
Advertisements

Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri.
Access Tables 1. Creating a Table Design View Define each field and its properties Data Sheet View Essentially spreadsheet Enter fields You must go to.
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.
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.
BA271 Week 7 Lecture Building the database Dave Sullivan.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Querying a Database Microsoft Office Access 2003.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
Lesson 32: Designing a Relational Database. 2 Lesson Objectives After studying this lesson, you will be able to:  Identify and apply principles for good.
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.
Microsoft Office 2003: Advanced 1 ADVANCED MICROSOFT ACCESS Lesson 7 – Modifying Table Design.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Microsoft Access Lesson 3
Microsoft Access 2000 Creating Tables and Relationships.
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.
Tables. What is a Table? A part of a database Container for data Pieces of data, put together, have a meaning.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
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 Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
© 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.
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T6: Basic Skills and Tools Using Access 2010 Business Driven Technology.
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.
Microsoft Access Intro Class 6 Relationships.
Using Microsoft Access 56:150 Information System Design.
Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.
Database collection of related information stored in an organized form Database program software tool for storage & retrieval of that information.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
McGraw-Hill/Irwin © The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T6 Basic Skills Using Access.
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.
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.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Build a database III: Build relationships for a new Access database Overview: You can relate This course teaches you how to build relationships between.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
Lesson 2: Designing a Database and Creating Tables.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
© 2001 ComputerPREP, Inc. All rights reserved. Access 2000: Module II.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
D1 FMA Review. Many-to-Many Relationships - Examples Car Hire –A customer may hire one or more cars –A car may be hired by one or more customers Gym Club.
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.
Database Relationships Objective 5.01 Understand database tables used in business.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall. 1 Skills for Success with Microsoft ® Office 2007 PowerPoint Lecture to Accompany.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Tables & Relationships
and Defining Table Relationships
CIS 155 Table Relationship
Microsoft Access Validation Rules, Table Relationships And
Relationships While we are on the subject of Relationships, let’s take a quick look at them.
Presentation transcript:

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 table, the field in the second table is called a foreign key 4.If the PK is AutoNumber and related to a FK, the FK is Number 5.If the PK is any data type except AutoNumber and related to a FK, the FK is the same data type

Constraints

Data Entry Control Standardize data entry – Validation Rules – Default Values – Feeder Tables – Input Masks

Validation Rules Field property Set to limit range of numbers or items Single item – > 1998 Multiple items – “ND”, “SD”

Validation Text Message to let end user know why entry will not work – “Year must be after 1998” – “Please use a two character state abbreviation such as ND”

Default Values Automatically entered Only change data if it is different

Feeder Tables Table with all data options for a field in a different table Appears as list or combo box

Story Time Garbage In Garbage Out – 400,000 vs. 4,000,000

Relationships

Types One-to-One One-to-Many Many-to-Many

One-to-One Least common Used when you have a data dump that is temporary Used when huge number of records but only a few will have this data

One-to-Many Most common – One student many classes – One customer many invoices – One person many DVDs

Many-to-Many Requires a bridge or junction table – Many teachers have many students in many classrooms

Simple to Establish Drag and drop – MemberID to MemberID

Edit Relationships Window Insure you selected the correct fields Enforce Referential Integrity Cascade Update Related Records Cascade Delete Related Records Relationship type

Referential Integrity Prevents orphan records – No records on the many side without a record on the one side – No membership dues paid without a member

Cascade Update Related Fields If primary key is not AutoNumber, please select – If using a social security number and a data entry error was made, when you correct the error, the database automatically goes to related records and corrects them.

Cascade Delete Related Fields When you delete one record, the related records are automatically deleted Watch for – If the related records contain numbers such as dues or donations and you delete them, you will not be able to generate statistical comparison reports.

Relationship Type Type of relationship is displayed If incorrect – Correct fields selected? – Correct data types