CIS 155 Table Relationship

Slides:



Advertisements
Similar presentations
Database Relationships in Access As you recall, the data in a database is stored in tables. In a relational database like Access, you can have multiple.
Advertisements

Table Relationships RDBM. Prof. Leighton2 Establishing Table Relationships RDBMS allow us to establish relationships among tables Have a primary key in.
Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri.
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.
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.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Microsoft Access II Information Technology Services User Services User Training & Support.
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.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Microsoft Access Lesson 3
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
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.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
® 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.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
© 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,
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.
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.
® 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.
Microsoft Access Intro Class 6 Relationships.
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.
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.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Build a database III: Build relationships for a new Access database Overview: You can relate This course teaches you how to build relationships between.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
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.
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.
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
Constraints Advanced Database Systems Dr. AlaaEddin Almabhouh.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Access Tutorial 2 Building a Database and Defining Table Relationships
New Perspectives on Microsoft Access 2016
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA
Tables & Relationships
Introducing Databases
Microsoft Access 2016 Design and Implement Powerful Relational Databases Chapter 6.
Objectives Query for top values Create a parameter query
and Defining Table Relationships
Relational Databases.
Microsoft Office Illustrated Fundamentals
Microsoft Access 2003 Illustrated Complete
Microsoft Access 2003 Illustrated Complete
Databases A brief introduction….
Design and Implement Powerful Relational Databases Chapter 6
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.
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 2 Building a Database and Defining Table Relationships
Guide to Modeling Keys to E-R diagrams.
Chapter 17 Designing Databases
Microsoft Access Validation Rules, Table Relationships And
Guide to Modeling Keys to E-R diagrams.
Relationships While we are on the subject of Relationships, let’s take a quick look at them.
Presentation transcript:

CIS 155 Table Relationship

Examining Access Objects The seven Access objects. Database Queries Based on tables Forms Reports Pages Forms, Reports, and Pages are based on tables or queries Macros Modules

Examining Access Objects (cont.)

Examining Relationships An Access database is a relational database because more than one table can share information or “relate.” Minimizes redundant information The process of designing a relational database is called normalization, which involves determining appropriate fields, tables, and table relationships

Examining Relationships (cont.) Enforce Referential Integrity. Means that you cannot enter values in the foreign key field unless you first enter them in the primary key field Also means that you cannot delete records in the “one” table if the “many” table has corresponding related records Cascade Update Related Fields. Automatically updates the data in the foreign key field when the matching primary key field is changed

Examining Relationships (cont.) Cascade Delete Related Fields. Automatically deletes all records in the “many” table if the record with the matching field in the “one” table is deleted

Examining Relationships (cont.) Foreign key field Data number type

Examining Relationships (cont.) “many” table “one” table Linking field Relationship type

Examining Relationships (cont.) One-to-many link with referential integrity “One” symbol Primary key field in the “one” table Foreign key field in the “many” table “Many” symbol

Examining Relationships (cont.) Relationship types

Relational Databases (cont.) Tables in the same database should be related, or linked, through a common field in a one-to-many relationship The primary key field in one of the tables creates the “one” side of the relationship and the foreign key field in the other table creates the “many” side of the relationship The foreign key field contains the same value “many” times to create a one-to-many relationship between the tables

Examining Relational Databases (cont.) A single table with duplicate information

Relational Databases (cont.) One-to-many relationships

Relational Databases (cont.) Many-to-many relationships. To join two tables that have a many-to-many relationship, you must establish a third table, called a junction table A junction table creates separate one-to-many relationships with the two original tables

Planning Related Tables and Lookups A well designed database minimizes redundant data. Related tables planning guidelines. List all of the fields of data that need to be tracked Group fields together in subject matter tables Identify primary key fields that exist in tables Link the tables with a one-to-many relationship via a common field

Planning Related Tables and Lookups (cont.) Related tables planning guidelines (cont.) Create lookups Lookups are reference tables or lists that are used to populate the values of a field Lookups are established by adding properties to the field for which you want to lookup behavior to occur Fields that contain lookup properties are called lookup fields

Planning Related Tables and Lookups (cont.) One-to-many relationship Linking SSN field Linking CourseID field

Planning Related Tables and Lookups (cont.) Lookup fields

Planning Related Tables and Lookups (cont.) Identifying key field combinations. Identifying a single primary key field may be difficult in some tables When individual fields can’t serve as a valid key field, combine fields together to make a key field combination

Creating Related Tables All characteristics of a table are defined in the Table Design View. Field names, data types. Field descriptions, primary key field A key symbol indicates that a field is defined as the primary key field

Creating Related Tables (cont.) Primary Key button

Creating Related Tables (cont.) Comparing linked to imported tables. The data in a linked table is stored in a file that is separate from the open database An Excel workbook can be linked to Access An imported table is a copy of data from an external file. Works the same as a table created in Access

Creating One-to-Many Relationships Once the initial database design and table design is completed, you need to link the tables together. Use a one-to-many relationship Create queries, reports, and forms with fields from multiple tables

Creating One-to-Many Relationships (cont.) “Many” side of the one-to-many relationship Bold identifies a primary key field “One” side of the one-to-many relationship

Creating One-to-Many Relationships (cont.) Enforcing referential integrity. Referential integrity is a set of rules that help ensure that no orphan are entered or created in the database An orphan record is a record in the “many” table that doesn’t have a matching entry in the linking field of the “one” table Prevents a user from deleting a record from the “one” table if a matching entry exists in the linking field of the “many” table