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.

Slides:



Advertisements
Similar presentations
Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.
Advertisements

Designing Tables in Microsoft Access By Ed Lance.
Relational Database Systems Higher Information Systems Advanced Implementation in Filemaker Pro.
Exploring Microsoft Access 2003 Chapter 5 One-to-Many Relationships : Subforms and Multiple Table Queries.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Relationships Relational Database. Identifying Entities… In the previous tutorial you learnt about identifying entities in a flat file database. Also.
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.
© Steven Alter, 2007, all rights reserved Database concepts Difference between a database and the Internet Reason for having a defined data structure Relational.
BA271 Week 7 Lecture Building the database Dave Sullivan.
Accounting Databases Chapter 2 The Crossroads of Accounting & IT
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Keys Chapter 8 Database Design for Mere Mortals. Why Keys Are Important They ensure that each record in a table can be properly identified. They help.
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.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Database Relationships Objective 5.01 Understand database tables used in business.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Database Applications – Microsoft Access Lesson 2 Modifying a Table and Creating a Form 45 slides in presentation Accessibility check 9/14.
Microsoft Access Lesson 3
Microsoft Access 2000 Creating Tables and Relationships.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
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,
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.
Designing a Database (Part I) -Identify all fields needed to produce the required information -Group related fields into tables -Determine Each Table’s.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
Microsoft Access 2013 Design and Create Tables to Store Data Chapter 2.
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,
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
What we’ve learnt Doc 5.69 Doc 5.70 Section 1-3. A simple database Related objects Tables hold the data Forms, reports, queries to access the data.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  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.
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and 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.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
ITGS Databases.
1 Database Systems Introduction to Microsoft Access Part 2.
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.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
Exploring Office Grauer and Barber 1 One-to-Many Relationships: Subforms and Multiple-Table Queries(Wk7)
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
Mr C Johnston ICT Teacher
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
Introduction to Databases Angela Clark University of South Alabama.
Chapter 6 Many-to Many Relationship. Agenda AutoNumber Many-to-many relationship Cascaded updating and deleting Auto Lookup Parameter query Total query.
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.
Database Relationships
Databases Chapter 9 Asfia Rahman.
CIS 155 Table Relationship
Microsoft Access 2013 Design and Create Tables to Store Data
Database Relationships
Database Relationships
Microsoft Access Validation Rules, Table Relationships And
Chapter 2 Design Table and Form.
Chapter 2 Design Table and Form.
Presentation transcript:

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 –A member may book one or more classes –A class may be booked by one or more members

Linking Table Breaks many-to-many relationship into two one- to-many relationships Car Hire – bookings table –Each record relates to a booking made by one customer for one car. –A customer may make one or more bookings –A car may be hired by one or more customers Gym Club – bookings table –Each record relates to a booking made by one member for one class –A member may book one or more classes –A class may be booked by one or more members

Gym Club Model Composite Primary Key The combination of ClassID and MemberID is guaranteed to be unique as a member can only have one booking for each class. What is the problem with using MemberID as the primary key for the bookings table?

Car Hire Model Composite Primary Key The combination of CarID and StartDate is guaranteed to be unique as a car cannot be booked more than once on the same date. Why is it not suitable to use CarID and Hirer as a composite Primary Key for the Hire Details table?

Non-key dependencies- Car Hire Cars are classified by Type. Cost per day relates to the type not to the car. Split into two related tables What is the advantage of doing this?

Non-key dependencies - Gym Club Each member has a particular status Fee and number of classes relate to the status not to the member What are the advantages of splitting the data in this way?

Referential Integrity You must enforce referential integrity for all the relationships in your database Prevents a record from being deleted from the parent table if there are related records in the child table Requires every foreign key in the child table to relate to a primary key in the parent table.

Examples A customer/member whose details are not recorded in the customer/member table cannot make a booking for a car/class A customer/member cannot be deleted from the customer/member table if there are bookings recorded for that customer/member Bookings cannot be made for cars/classes that are not recorded in the database A class/car cannot be deleted if bookings exist for that class/car

Primary and Foreign Keys A foreign key in a child table must have the same data type and size as the primary key in its parent table. An autonumber is a numeric data type with size …? A foreign key relating to an autonumber primary key will have the data type …? with size...? Should the foreign key be an autonumber? Do the primary and foreign keys have to have the same field name?

Using Field Properties Use field properties to control the data that can be entered into your tables and reduce the risk of errors You don’t have to set all properties for all fields Consider which ones are appropriate and set them accordingly

How might these field properties be used? Field Size Format Input mask Caption Default value Validation rule\text Required

Remember… Tables and relationships are the foundations of your database You must get them right before you start to build other objects – queries, forms, reports – based on them It is complicated (and a lot of work) to modify the underlying structure of the database once you have created your queries, forms and reports Spend the time to get this right before you go any further