Database Relationships Objective 5.01 Understand database tables used in business.

Slides:



Advertisements
Similar presentations
Relationships Relational Database. Identifying Entities… In the previous tutorial you learnt about identifying entities in a flat file database. Also.
Advertisements

Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Exploring Microsoft Access 2003 Chapter 6 Many-to-Many Relationships: A More Complex System.
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.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Accounting Databases Chapter 2 The Crossroads of Accounting & IT
Implementing an REA Model in a Relational Database
Databases and Database Management Systems
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
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.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
 An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database.  An Entity Relationship.
Database Relationships Objective 5.01 Understand database tables used in business.
Databases & Data Warehouses Chapter 3 Database Processing.
Microsoft Access Database software. What is a database? … a database is an organized collection of data. A collection of data of similar information compiled.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
2.3 Organising Data for Effective Retrieval
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.
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
1 California State University, Fullerton Chapter 7 Information System Data Management.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
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.
Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.
© 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,
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
Implementing an REA Model in a Relational Database
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  Database.
Organizing Data and Information. What is Data?? Numbers, characters, images, or other method of recording, in a form which can be assessed by a human.
1 Database Concepts 2 Definition of a Database An organized Collection Of related records.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Relational Database. Database Management System (DBMS)
Microsoft Access Intro Class 6 Relationships.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Implementing an REA Model in a Relational Database
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.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
Forms and Subforms 5.02 Understand database queries, forms, and reports used in business.
Database revision.
File and Database Design Class 22. File and database design: 1. Choosing the storage format for each attribute from the logical data model. 2. Grouping.
Quiz questions. 1 A data structure that is made up of fields and records? Table.
Lesson 2: Designing a Database and Creating Tables.
Forms 5.02 Understand database queries, forms, and reports.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
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.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
Introduction to Databases Angela Clark University of South Alabama.
Database Relationships Objective 5.01 Understand database tables used in business.
Teanna Clarke 6aQ What is a Entity-Relationship Diagram?  An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Database Relationships
CIS 155 Table Relationship
Database Relationships
CSCI-100 Introduction to Computing
5.02 Understand database queries, forms, and reports used in business.
Relational Queries (query 12) Display vendor contact info (contact person and phone number) for inventory products (relationship query) Query: Inventory.
Database Relationships
Presentation transcript:

Database Relationships Objective 5.01 Understand database tables used in business

Relationships A relationship means that two or more tables are linked together by a common field, called a primary key field. Table relationships increase the power of the database by allowing data to be stored separately, but managed and retrieved collectively.

Slide Understand database tables used in business Making Friends with Relations Relationships link data from individual tables and increase the usefulness of a database. One of the great benefits of working with databases is the ability to store huge quantities of information. One company’s database may contain multiple tables of related information. When the information between tables is linked, it is called a relationship.

What does a relationship look like? One record in the Student Table is related to one record in the Participation Table Relationship established between two tables

Keys to the Relationship A primary key is an essential element of a database table. It is a data type that is set to make each record within a database table unique and to link tables together. Primary key fields must be of the same data type and size for the tables to which they link. The red line that graphically represents the relationship is called a Join Line

What makes a good primary key? Which of the following would make each record in a database unique? Social security number Social security number Last name Last name First name First name Automobile VIN number Automobile VIN number Birth date Birth date Product serial number Product serial number

Primary and Foreign Keys When tables relate, the primary key of one table becomes a foreign key of the other table For example, in the tables below, ISBN appears as a primary key in the Grocery Products table...…and in the Orders Table as a foreign key

Diagram of Primary & Foreign Keys Understand queries, forms, and reports.

Function of the Junction Table A junction table is used to join primary key fields of multiple tables The Junction table is like a hub or control center In this example, Orders is the Junction Table. It allows the Grocery Products and the Customers tables to share information.

One-to-Many One-to-Many One record in Table A links to multiple records in Table B through the primary/foreign key fields of the two tables One record in Table A links to multiple records in Table B through the primary/foreign key fields of the two tables

Many-to-Many Many-to-Many Multiple records in multiple tables are linked by their primary keys through a Junction Table. Multiple records in multiple tables are linked by their primary keys through a Junction Table. A many-to-many relationship is formed by connecting two or more tables that have a one-to-many relationship. The connection is made by a Junction Table. A many-to-many relationship is formed by connecting two or more tables that have a one-to-many relationship. The connection is made by a Junction Table.

Setting up a Relationship Add one table’s primary key to a field in another table that has the same properties The primary key in Grocery Products is ISBN The primary key in Orders is Order No The primary key in Customers is Store ID

Referential Integrity Referential integrity protects related data that is stored in multiple tables. It would prevent a customer in one table from being deleted if the customer is also in a related table.

Relationship Discussion A music store database contains three tables. An Inventory table is linked by artist to a Royalty table which contains the artist’s contact information and royalty percentages The Inventory table is also linked to a Sales table by salesperson ID numbers, which contains employee information and commission rates Once a purchase is made, the inventory is adjusted in one table and the artist’s royalties and employee’s commissions are calculated from the information in the other tables What are the advantages of this system? Are there disadvantages?