Overview/Review of DB Logical Design ER Model to Relational Model Mapping.

Slides:



Advertisements
Similar presentations
Banking Business Scenario
Advertisements

ER to Relational Mapping. Logical DB Design: ER to Relational Entity sets to tables. CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER,
1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
The Relational Database Model – some relations you might want to avoid!!!
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
Logical Database Design and Entity-Relationship Mapping “To Err is Human; to Forgive, Divine.” ~ Alexander Pope ~
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
Lecture 9: Data Design CSC 470 Spring 2010.
1 Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design.
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
LOGICAL DATABASE DESIGN
Mapping ERM to relational database
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
2Object-Oriented Analysis and Design with the Unified Process Objectives  Describe the differences and similarities between relational and object-oriented.
Lecture 3 The Relational DB Model. Learning Objectives That the relational database model takes a logical view of data That the relational model’s basic.
DATA MODELING AND DATABASE DESIGN
CHAPTER 2. FUNDAMENTAL OF ENTITY RELATIONSHIP (ER)
BIS 360 – Lecture Six (Part 2) Conceptual Data Modeling (Chapter 10 and partial Chapter 12)
Chapter 6 Normalization 正規化. 6-2 In This Chapter You Will Learn:  更動異常  How tables that contain redundant data can suffer from update anomalies ( 更動異常.
SQL Structured Query Language Programming Course.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
Chapter 9 Methodology - Logical Database Design Chapter 16 in Textbook.
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.
CS370 Spring 2007 CS 370 Database Systems Lecture 4 Introduction to Database Design.
CS 3630 Database Design and Implementation. 2 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
Logical Database Design and Entity-Relationship Mapping “To Err is Human; to Forgive, Divine.” ~ Alexander Pope ~
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 Database & DBMS The data that goes into transaction processing systems (TPS), also goes to a database to be stored and processed later by decision support.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
Dr Gordon Russell, Napier University Data Analysis 3 - V2.0 1 Data Analysis 3 Unit 2.3.
Section 04 Lesson 01 Introduction to the Database
Data Analysis 3 Chapter 2.3 V3.0 Napier University Dr Gordon Russell.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
CS263 Lecture 5: Logical Database Design Can express the structure of a relation by a Tuple, a shorthand notation Name of the relation is followed (in.
Database Design – Lecture 6 Moving to a Logical Model.
Copyright © Curt Hill Entities and Relationships The basics and what they have to do with database.
Modelling Methodologies Chapter 16, 17, 18. Modeling Methodologies2 Database Design Physical DB design Logical DB design Conceptual DB design Hardware.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
Data Analysis 4 Chapter 2.4 V3.0 Napier University Dr Gordon Russell.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 1.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
Connecting (relating) Data Tables to get Custom Records (Queries) Database Basics.
CS 3630 Database Design and Implementation. Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
Bordoloi CMIS 450: Database Design Dr. Bijoy Bordoloi Transforming E/R Diagrams to Relations.
Database Design 4: Deriving Tables From Data Models CS 320.
Database Design. Database Design Process Data Model Requirements Application 1 Database Requirements Application 2 Requirements Application 4 Requirements.
Howard Paul. Sequential Access Index Files and Data File Random Access.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
CS 3630 Database Design and Implementation
The Relational Data Model and Relational Database Constraints
Logical Database Design for the Relational Model
CS 3630 Database Design and Implementation
INF385T: Information Modeling — Class 11 Relational Database Design from ER Models Presented November 2 Karen Wickett,
Assignment 4 Map entities with relationships to relational schemas.
Constraints AND Examples
Order Database – ER Diagram
Database Management System
Logical Database Design
DBMS ER-Relational Mapping
Constraints AND Examples
Presentation transcript:

Overview/Review of DB Logical Design ER Model to Relational Model Mapping

Transforming ER into RDB attr relationships entities table ERRDB

Transforming ER into RDB (2) Make a relation for each entity  Unique identifier of entity becomes key of relation  Attributes of entity becomes attributes of relation For each 1 - M relationship:  Take the primary key of the 1-side entity and place it as a foreign key in the M-side entity relation

Transforming ER into RDB (3) relationships can be mapped similarly when compared to 1 - M’s  Where do you house the foreign key? Make a relation for each M - M relationship  Attributes of relation Attributes of relationship + key of each entity  Primary key of relation Unique identifier of each entity {+ attribute of relationship}

Transforming ER into RDB (4) Example: Staff (StaffNo, Address, …) Branch (BranchNo, TelNo, …) Property (PropNo, Rent, …, StaffNo, BranchNo) IsAllocated (StaffNo, BranchNo, Percent) Staff IsAllocated Branch Oversees Property Has StaffNo PropNo BranchNo M M 1M M 1 Rent Address Percent TelNo Note: Underline attributes are PKs and italics are FKs; an attribute can be both PK and FK

Transforming ER into RDB (5) Sometimes a 1 - M relationship should be mapped into a separate relation E.g., Employee (Emp#, …) Car (Car#, …) IsAssigned (Emp#, …., Car#) Emp# Car# IsAssigned Employee Car M1

ER to Relational: Exercise Owns Car MarriedTo Accident Logs License# VIN M M 1M 1 Damage $ Person SS# model Spouse SS# 1 Age