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.

Slides:



Advertisements
Similar presentations
Objectives Create an action query to create a table
Advertisements

Chapter 4 Joining Multiple Tables
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Database Design Week 10.
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.
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.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
ISP 121 Week 1 Introduction to Databases. ISP 121, Winter Why a database and not a spreadsheet? You have too many separate files or too much data.
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.
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
Inner join, self join and Outer join Sen Zhang. Joining data together is one of the most significant strengths of a relational database. A join is a query.
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?
Microsoft Access Database software. What is a database? … a database is an organized collection of data. A collection of data of similar information compiled.
Copyright 2003, Paradigm Publishing Inc. CHAPTER 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Table Wizard Spell Check Find Data Find and Replace Data Find and.
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
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
2.3 Organising Data for Effective Retrieval
© 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 4 – Creating New.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
1 MySQL and phpMyAdmin. 2 Navigate to and log on (username: pmadmin)
1 Lesson 22 Getting Started with Access Essentials Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Microsoft Access Lesson 1 Lexington Technology Center February 11, 2003 Bob Herring On the Web at
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
© 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.
WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.
CS 101 – Access notes Databases (Microsoft Access) 4 parts of a database database design –Try to understand the ideas behind database design, not just.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
More about Databases. Data Entry through Forms Table View (Data sheet view) is useful for data entry of new records But sometimes customization would.
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
Microsoft Access Intro Class 6 Relationships.
Using Microsoft Access 56:150 Information System Design.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making Chapter.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Microsoft Access 2013 ®® Tutorial 9 Using Action Queries and Advanced Table Relationships.
Unit 5, Lesson 1 Working with Databases. Objectives Identify the parts of the Access screen. Identify the parts of the Access screen. Understand the purpose.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
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.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Access 2002 Lab 3 Analyzing Tables and Creating.
Lesson 2: Designing a Database and Creating Tables.
Basic ALEPH ( Library Online Catalog) Anne Bardolph, Acquisitions Librarian FSU College of Law Library Fall 2006.
MS ACCESS How and Why Second Semester First Quarter Project One.
Review Types of Relationship – there are in general three different types of relationships - One to One – where each record in one table can have not more.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Access Test Questions Test Date: 05/05/16. Chapter 1 (Lynda.com) Question 1 An access database uses five main components (database objects). Which is.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Objectives Query for top values Create a parameter query
Objectives Create an action query to create a table
CIS 155 Table Relationship
More about Databases.
Relational Queries (query 12) Display vendor contact info (contact person and phone number) for inventory products (relationship query) Query: Inventory.
Tutorial 9 Using Action Queries and Advanced Table Relationships
New Perspectives on Microsoft
Presentation transcript:

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 tables and you can relate fields in one table to fields in another. For example, a country in the West Africa table could be related to the nationality of the people in the Famous Africans table. Then if you search for information about the country Ghana, you could also see the Famous Africans from Ghana

As another example, a book thats been checked out of the library could be related to the student who checked it out. When a librarian looks up information about the book in one table, it is linked to the students information (address, phone number, etc) in the other table.

Creating relationships is important because it avoids unnecessary duplication of data. For example, the library need not keep its own list of students addresses. Creating relationships is also more efficient. For example, if a students address changes, it only needs to be updated in one table, and the other tables that are linked to it will have access to the revised data.

Relationship Review When working with databases, you may want to access info from several tables at once. To do so, you must create relationships between the tables. Such relationships tell access how to match the info from separate tables.

Relationship Review Cont When creating relationships, you always work with two tables at a time. One table is called the primary table and the other is called the related.

Types of Relationships Relationships may be one-to-one, one-to many, or many-many. One-to-many relationships are the most common. One table (the parent) can have many matching records in another table (the child).

Note Before you create a relationship between tables, it must meet these requirements: Both tables need to be in the same database file. If they are in separate files, you need to import a table from one database file to another (File, Get External Data, Import). Both tables need to have a primary key defined (open the Table, choose view, design view, then click in the field and click the key icon or choose Edit then Primary KEY)

Note Cont The two related fields must be of the same data type (number, text, date/time, etc) The data in the two related fields must match. That is, dont enter Ghana in the Country field and Ghanaian in the Nationality field. Use Ghana in both cases.

When you fail to join two or more tables, you will produce a query results datasheet in which every record in say table A is joined with every record in say table B. This is called a cross or cartesian product. If you create join fields that do not contain common data, the query results datasheet will show unexpected results.

Types of Joins There are three basic types of joins in Access: 1.Inner joins, which are also known as equi-joins 2.Outer joins 3.Self joins

Types of Joins Cont An inner join is the default join in Access. Access select only those records from both tables that have a matching value in the fields that joined. If a record in say table A has a value in the join field that is not found in the corresponding field in any of the records in say table B, then that record is not included in the query results.

Types of Joins Cont Inner Join Type Table A Table B

Types of Joins Cont An outer join includes all the records from one table and only those records in the second table that have matching values in the joined field. We have the Left Outer Join and Right Outer Join.

Types of Joins Cont Left Outer Join Type Table B Table A

Types of Joins Cont Right Outer Join Type Table A Table B

Types of Joins Cont In Access the first Join Type is the Inner Join and the second and third Join Types are Left and Right Outer Joins Respectively.

Types of Joins Cont A self join relates the data between records in a single table. For example, if your table records measurements overtime, and each record represent a sampling, you may want to compare the measurement between records.

Types of Joins Cont To create a self join, you must add the table to the query twice and join the related fields. By joining the two copies of the same table, you create a self join that combines records from the same table when there are matching values in the joined tables.

Types of Joins Cont You can use a self join in any situation in which you need to compare records in the same table to one another.