Tables & Relationships

Slides:



Advertisements
Similar presentations
Table Relationships RDBM. Prof. Leighton2 Establishing Table Relationships RDBMS allow us to establish relationships among tables Have a primary key in.
Advertisements

The Ribbon Standard to all Office 2007 applications Organized by feature and functionality Navigation Pane Access to all objects in the current database.
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.
Computer Science & Engineering 2111 Introduction to Database Systems 1CSE 2111-Introduction to Database Systems.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Relational Model Stores data as tables –Each column contains values about the same attribute –Each column has a distinct name –Each row contains values.
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.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
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.
Database Relationships Objective 5.01 Understand database tables used in business.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
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.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
® Microsoft Office 2010 Access Tutorial 2 Building a Database and Defining Table Relationships.
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
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.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  Database.
Computer Science & Engineering 2111 Lecture 10 Introduction to Database Management Systems 1.
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.
Microsoft Access 2013 Design and Implement Powerful Relational Databases Chapter 6.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
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.
Relational Theory and Design
1 MS Access. 2 Database – collection of related data Relational Database Management System (RDBMS) – software that uses related data stored in different.
1 CHƯƠNG 4 Creating Relational Databases Understanding Table Relationships Example: This database tracks customers and their orders in two separate.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
AOIT Database Design Unit 3, Lesson 9 Data Integrity Copyright © 2009–2011 National Academy Foundation. All rights reserved.
Database Constraints ICT 011. Database Constraints Database constraints are restrictions on the contents of the database or on database operations Database.
Introduction to Database Systems
Basic Criteria in Queries
Databases Chapter 9 Asfia Rahman.
Microsoft Access 2016 Design and Implement Powerful Relational Databases Chapter 6.
Inner Joins Objectives: Creating Queries with data from Multiple Tables Joining two tables using an Inner Join Referential Data Integrity Cascade Update.
Objectives Query for top values Create a parameter query
and Defining Table Relationships
Database Keys and Constraints
CSIS 115 Database Design and Applications for Business
CIS 155 Table Relationship
CSIS 115 Database Design and Applications for Business
Microsoft Office Illustrated Fundamentals
Basic Criteria in Queries
Database Relationships
Introduction to Database Systems
Microsoft Access 2003 Illustrated Complete
Design and Implement Powerful Relational Databases Chapter 6
Microsoft Office Access 2003
Insert, Update, Delete Manipulating Data.
5.02 Understand database queries, forms, and reports used in business.
Access Lesson 2 Creating a Database
Microsoft Office Access 2003
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.
Chapter 17 Designing Databases
LISTING INCIDENT ID 1 Category Listing Status Submitted
CS122 Using Relational Databases and SQL
Microsoft Access Validation Rules, Table Relationships And
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:

Tables & Relationships Quick Review-Steps when Creating a Database Steps to complete before creating the database using the software Decide what information you will store in the database Create the layout of the database Create a relationship diagram to identify the table relationships, primary keys and foreign keys 4. Create the database using the database software

Create the database using the database software Create the Database File Create the tables Fields Primary keys Field Types Field Properties We know the information we want to store, but how do we match a customer’s name to their charges and payments? We need a way to relate these two tables to extract useful information. We can relate these two tables by matching the Client ID We do this by “Joining” the tables Create the Relationships

∞ 1 Parent Child Table Name: Client Primary Key: ClientID Table Name: Payments Primary Key: None FK: ClientID On Payments table

Relationship Rules Must be a primary key in least one of the tables in the relationship. The related fields must be the same data type number, text etc. The foreign key field must contain the same information as the primary key field. The field names on each table do not have to match as long as the information is the same. FK: ClientID On Payments table Table Name: Client Primary Key: ClientID Table Name: Payments Primary Key: None

Referential Data Integrity A set of rules that specifies what records may exist in each table A record input with a foreign key must always have a matching record in the primary key table in the relationship

Cascade Delete Related Records Removing any entry in a primary key field will automatically remove all entries in foreign key fields of related tables. Cascade Update Related Records Updating any entry in a primary key field will automatically update all entries in foreign key fields of related tables.

∞ ∞ ∞ 1 1 1 Parent Parent Child Child Child Parent Table Name: Client FK: ClientID On Payments table FK: ClientID On Charges table Table Name: Client Primary Key: ClientID Parent Parent 1 1 Child ∞ Child ∞ Table Name: Payments Primary Key: None Table Name: Charges Primary Key: None ∞ Child FK: PaymentType On Payments table 1 Parent Table Name: MethodTypes Primary Key: MethodID A Foreign Key (FK) is a field that defines the relationship between 2 tables.