Intro to MIS – MGS351 Relational Database Design Extended Learning Module C.

Slides:



Advertisements
Similar presentations
Normalisation.
Advertisements

Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
First Normal Form Second Normal Form Third Normal Form
Accounting System Design
Logical Data Modeling Review Lecture for University of Agder, Grimstad DAT202 Databaser (5.5.11) Judith Molka-Danielsen
Accounting 6500 Relational Databases: Accounting Applications Introduction to Normalization.
© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Entity-Relationship Model and Diagrams (continued)
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Database Fundamentals Lecture 5. The Design Process continued.
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
Relational Data Analysis II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Project and Data Management Software
Database – Part 2a Dr. V.T. Raja Oregon State University.
NORMALIZATION N. HARIKA (CSC).
Computer Science & Engineering 2111 Introduction to Database Management Systems Relationships and Database Creation 1 CSE 2111 Introduction to Database.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Concepts and Terminology Introduction to Database.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
WEEK 10 Database Design. Agenda – Week 10 Review Hybrid Review Table Instance Charts Primary Keys Normalization.
Normalization Information Systems II Ioan Despi. Informal approach Building a database structure : A process of examining the data which is useful & necessary.
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
Microsoft Access Intro Class 6 Relationships.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Logical Database Design and the Relational Model.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
Detailed Data Modeling. Outline Data Modeling Modeling Constructs –Entities –Relationships –Cardinality Model Basic Rules Advanced Rules Prototyping Process.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Lecture 4: Logical Database Design and the Relational Model 1.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
Database Planning Database Design Normalization.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
Year 12 > 13 Applied GCE ICT Unit 7 Using Database Software.
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
Let try to identify the conectivity of these entity relationship
Intro to MIS – MGS351 Relational Database Design
Chapter 5: Logical Database Design and the Relational Model
Entity-Relationship Model and Diagrams (continued)
Accounting System Design
Normalization Referential Integrity
Relational Database.
Entity relationship diagrams
Accounting System Design
Chengyu Sun California State University, Los Angeles
Chapter 17 Designing Databases
CSIS 254 Oracle Normalization
Database Management system
Presentation transcript:

Intro to MIS – MGS351 Relational Database Design Extended Learning Module C

Database Design Overview m Relational Database Design m Entity Relationship Diagrams m One-to-One (1:1) m One-to-Many (1:N) m Many-to-Many (N:M) m Database Normalization – First, second and third normal form

Relational Databases m Store data in the form of related tables. m Relational design is based on database normalization and can be accomplished with ERD’s.

Relational Databases Benefits m Ensures data integrity and referential integrity – Adding, deleting, updating records m Powerful to use

Design Principles m You must become a business expert m Poor relational database design leads to system failure m Proper design accurately reflects the organization’s business rules m Relational database design is both an art and science

Entity Relationship Diagrams m Diagramming tool used to design a relational database – analogous to a “blueprint” for databases. Used by designers to: – Organize relational design on “paper” – Communicate design to end users and business experts for verification

Entity Relationship Diagrams m If designed properly, an ERD will accurately reflect the business rules of the organization. It will become a visual illustration of the organization’s business rules. Therefore, a database is just a reflection of these business rules.

Entity - Relationship Diagrams

Entity Relationship Diagrams m Entity - Something about which data is kept m Attribute - Descriptive value associated with an entity m Key Attribute - Attribute(s) that uniquely identify an entity Customer entity has name, address, fax number and phone number attributes

Entity Relationship Diagrams m Entities correspond to database tables m Attributes correspond to database fields in a table m Key attributes correspond to primary keys

One-to-One Relationship (1:1) StudentID Card 11 Issued Joe Sally Tom Jean

One-to-Many Relationship (1:N) StudentLibrary Book 1N Borrows Joe Sally Tom Book A Book B Book C Book D Book E

Many-to-Many Relationship (N:M) StudentCourse NM Enrolls Joe Sally Tom Jean MGS 351 MGA 201 MGQ 301 MGF 301 MGB 301

Multiple Relationships Faculty Student N M Course N1 TeachesEnrolls

Multiple Relationships Murray Boot MGQ302 MGS351 MGF301 MGB301 Rita Colleen Sean Jody Walt Mike Jordan Andrew Larry Joe Barb

ERD Reminders m Consider how time changes the relationship between entities. m Clearly define entities. m Identify all exceptions to the rule…often difficult to find even if you’re the business expert.

Transforming ERD to Tables m Transform entities into tables m Transform attributes into fields m Transform the key attribute into the primary key for the table

Transforming ERD to Tables m Applying these rules ensures all relationships simplify to 1:N m 1:1 - Relationships merge into one table. One entity becomes an attribute of the other m 1:N - Add primary key from the “one” entity as a foreign key in the “many” entity m N:M - Add intersection table which includes primary keys from both tables

Transforming ERD to Tables – N:M Detailed Steps 1.Add intersection table 2.Flip relationship lines around so “many” side faces the intersection table 3.Add primary keys from original tables as fields in the intersection table 4.Assign a name the intersection table 5.Add other relevant fields to intersection table if necessary

Transforming ERD to Tables – 1:1 StudentID Card 11 Issued Student ID Card Merge relationships into one table. One entity becomes an attribute of the other.

Transforming ERD to Tables – 1:N StudentLibrary Book 1N Borrows Person # 1:N – Add primary key from the “one” entity as a foreign key in the “many” entity Primary Key  Foreign Key 

Transforming ERD to Tables – N:M (Before) StudentCourse NM Enrolls M:N - Add intersection table which includes primary keys from both tables Person #Course #

Transforming ERD to Tables – N:M (After) StudentCourse Person #Course # Add intersection table

Transforming ERD to Tables – N:M (After) StudentCourse NN11 Person #Course # Flip relationship lines around so “many” side faces the intersection table

Transforming ERD to Tables – N:M (After) StudentCourse NN11 Person #Course # Person #Course # Add primary keys from original tables as foreign key fields in the intersection table

Transforming ERD to Tables – N:M (After) StudentCourse Registration NN11 Person #Course # Person #Course # Assign a name the intersection table

Transforming ERD to Tables – N:M (After) StudentCourse Registration NN11 Person #Course # Person #Course # Grade Add other relevant fields to intersection table if necessary

Transforming ERD to Tables – N:M (After) StudentCourse Registration NN11 Person #Course # Person #Course # Grade What should be used as Primary Key in the intersection table? Composite Primary Key or Autonumber

Determining Relationships CustomerLoan To determine the relationships between two entities, you have to ask the right questions. 1) Can a single Customer have one or many Loans? 2) Can a single Loan be related to one or many Customers?

Determining Relationships CustomerLoan 1N The answers to the two questions depend on the Bank’s business rules. For this example, we’ll say that a Customer can have many loans and a Loan can be related to only one Customer.

Determining Relationships CustomerLoan 1N 1) Can a single Loan have one or many Payments? 2) Can a single Payment be applied to one or many Loans? Payments

Determining Relationships CustomerLoan 1N Again, the answers depend on the Bank’s business rules. For this example, we’ll say that a Loan can have many Payments and a Payment can be applied to many Loans. Payments N M

Database Normalization Application of a number of rules to the relational model which will simplify the relations. – Avoid common database problems – Make the data as tightly bound as possible – Store the minimum amount of data

Un-normalized Example

Normalized Example Customers Orders Order DetailsProducts

Database Normalization Goal The fields in a table depend on the key, the whole key, and nothing but the key.

Database Normalization Steps 1NF - Remove repeating groups 2NF - Remove fields dependent only on part of the key field (Applies to concatenated keys) 3NF - Remove fields dependent only on other fields in that table

Un-normalized Order#, Cust#, CustName, CustAddress, ( Product#, ProductName, Quantity, ProductPrice), OrderDate Order

Line item Order#, Cust#, CustName, CustAddress, OrderDate Order#, Product#, ProductName, Quantity, ProductPrice First Normal Form (1NF)

Second Normal Form (2NF) Line item Product Order#, Product#, Quantity Product#, ProductName, ProductPrice

Third Normal Form (3NF) Order Customer Cust#, CustName, CustAddress Order#, Cust#, OrderDate