Introduction to MS Access: creating tables, keys, and relationships

Slides:



Advertisements
Similar presentations
Introduction to MS Access, building tables, creating keys, creating relationships BSAD 141 Dave Novak.
Advertisements

Entity-Relationship Model and Diagrams (continued)
The Relational Database Model:
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Chapter 5 Normalization of Database Tables
CS424 PK, FK, FD Normalization Primary and Foreign Keys Primary and foreign keys are the most basic components on which relational theory is based. Primary.
The Relational Database Model
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
1 n 1 n 1 1 n n Schema for part of a business application relational database.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T6: Basic Skills and Tools Using Access 2010 Business Driven Technology.
1 Database Concepts 2 Definition of a Database An organized Collection Of related records.
1 Database Systems Introduction to Microsoft Access Part 2.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
Relational Theory and Design
Lesson 2: Designing a Database and Creating Tables.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Logical Database Design and the Relational Model.
Howard Paul. Sequential Access Index Files and Data File Random Access.
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 2.
Lecture 4: Logical Database Design and the Relational Model 1.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
1 Finding Your Way Through a Database Exploring Microsoft Office Access.
Chapter 8: Object-Relational Modeling
CSIS 115 Database Design and Applications for Business
Logical Database Design and the Rational Model
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA
Databases Chapter 9 Asfia Rahman.
Chapter 4 Logical Database Design and the Relational Model
GO! with Microsoft Office 2016
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Chapter 9 Part-1: Concepts & Foreign Keys
Information Systems Today: Managing in the Digital World
Chapter 5: Logical Database Design and the Relational Model
Tables and Their Characteristics
CIS 155 Table Relationship
GO! with Microsoft Access 2016
Introduction to Database Systems
CSCI-100 Introduction to Computing
Logical Data Modeling.
Entity-Relationship Model and Diagrams (continued)
What is a Database and Why Use One?
Introduction lecture1.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
ERD’s REVIEW DBS201.
Normalization Referential Integrity
Database Fundamentals
Entity relationship diagrams
Entity Relationship Diagrams ERDs
Insert, Update, Delete Manipulating Data.
Constraints.
MIS2502: Data Analytics Converting ERDs to Schemas
Chapter 9 Part-1: Concepts & Foreign Keys
Session 2 Welcome: The seventh learning sequence
Business Application Development
Databases and Information Management
Access: Access Basics Participation Project
Database Design: Relational Model
Mapping an ERD to a Relational Database
Database Systems: Design, Implementation, and Management
Nagendra Vemulapalli Access chapters 1&2 Nagendra Vemulapalli
Presentation transcript:

Introduction to MS Access: creating tables, keys, and relationships BSAD 141 Dave Novak

Topics Covered Brief introduction to MS Access Normalization Name and save a DB file Create tables and keys Create and enforce relationships Convert a partial ERD to design in Access Examples of both entity integrity and referential integrity using Access Normalization Example

Important to note! If you are having trouble keeping up with the lecture or having some type of technical problems, you may need to read through the book and notes and work through the examples These will walk you through the basic features in MS Access and guide you through table and key creation as well as how to create relationships between tables

Example: Partial ERD Consider a relationship between a manager and a project Assume the following: Each manager can manage up to 5 different projects simultaneously Each manager must manage at least one project Each project is assigned to only 1 manager (there are no co-manager leads on the project) When entered into the DBMS, each project must be assigned to a manager

Example: Partial ERD Draw the partial ERD – discuss degree, connectivity, and existence

Two Types of RDBMS Integrity Rules 1) Entity Integrity Guarantees each entity (where each row in a table represents a unique entity) has a valid and unique PK (no missing or repeat values) 2) Referential Integrity All FK values (on the many side of the relationship) must first exist in the parent table (values must be first be entered conform to entity integrity on the one side of the relationship)

Two Types of RDBMS Integrity Rules In practice this means that once you have established the correct relationships between the tables in relational DB, enter the data for all tables on the ONE side of the relationship before entering any data for any table on the MANY side of the relationship

Building Tables in Access Create a DB file called “class-example1” Build 2 separate tables that correspond to the partial ERD you just drew Attributes for Manager (ManagerID, FirstName, LastName, Address, Salary) Attributes for Project (ProjectID, ProjectName, Duration, Phase) Model the relationship in Access and enforce referential integrity

Building Tables in Access 1) Create the “shell” or empty tables to begin with 2) Specify the data type for each attribute Manager (ManagerID (txt), FirstName (txt), LastName (txt), Address (txt), Salary (currency)) Project (ProjectID (txt), ProjectName (txt), Duration (txt), Phase(txt))

Link the tables using a Foreign Key Using our ERD and what you know about the location of Foreign Keys FK: Which table does the FK appear in? What is the FK attribute? Go into design view and add the FK attribute

Enter Data in Manager Table: Entity Integrity Error You get an error message if you violate entity integrity rules

Complete Manager Table Just use 5 attributes and enter 3 records I give you

Enter Data in Project Table Just use the 4 attributes and enter the 4 records I give you!

Populate the FK attribute: Referential Integrity Error We will end up with a referential integrity violation

Referential Integrity One of the FK attribute values in the Project Table (the M side of the relationship) does not exist in the parent table (the Manager Table – the one side of the relationship). There is NO manager ID 654-98-0033, so that ID value cannot be assigned to a project Manager ID?

Referential Integrity and Tables The specific value you enter for any FK attribute value must FIRST exist in the parent table Example: I cannot be assigned to teach a section of 141 (or any other class) if I am not first listed in the professor / teacher table You have a value for ManagerID that exists in the Manager table

Design Rules Normalization A systematic process to control / reduce redundancy and improve integrity in a RDB that involves organize all data into tables and columns Minimize duplicate data Minimize or avoid data modification issues Simplify queries

Design Rules Normalization Typically a trade-off between higher levels of normalization and processing speed As redundancy is reduced, the time it takes the DBMS to process a query or extract data can increase Higher levels of normalization may not always be desired where processing speed is critical

Design Rules We want to convert this single table DB file to a relational DBMS format

Design Rules There are clearly some redundancy issues with the data How do we address redundancy via normalization and organize the data into relational tables?

Step 1 The current format is just an Excel worksheet, not a relational DBMS Identify attributes of each entity (or fields to be placed in each table)

Step 2 Create tables and columns (attributes) needed to capture all data in a relational format Attributes and data related to a specific entity in one table and attributes and data related to another entity in a different table Design tables to minimize need to enter redundant information What do we do with attributes that pertain to both employee and project?

Step 3 Consider relationship connectivity (1:M, M:M) – may be a trial and error process What type of relationship best captures the data relationships we have here? Can employees work on more than 1 project at a time, or only 1 project at a time? Is each project staffed by only 1 employee, or can each project be staffed my multiple employees? We can tell by looking at the data in the Excel table

Step 4 Draw the partial ERD

Summary Introduction to MS Access Normalization Name and save a DB file Create tables and keys Create and enforce relationships Convert a partial ERD to design in Access Examples of both entity integrity and referential integrity using Access Normalization Example