Logical Database Design and Entity-Relationship Mapping “To Err is Human; to Forgive, Divine.” ~ Alexander Pope ~

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
The Relational Database Model – some relations you might want to avoid!!!
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Entity Relationship (ER) Modeling
Systems Development Life Cycle
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.
Database Design & Mapping
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling with ERD ISYS 363. Entity-Relationship Diagram An entity is a “thing” in the real world, such as a person, place, event for which we intend.
Relational Model Stores data as tables –Each column contains values about the same attribute –Each column has a distinct name –Each row contains values.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Mapping from E-R Model to Relational Model Yong Choi School of Business CSUB.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Modeling & Designing the Database
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Database Architecture The Relational Database Model.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 The Relational Model (Advanced)
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Mapping from Data Model (ERD) to Relational Model Yong Choi School of Business CSUB.
DATA MODELING AND DATABASE DESIGN
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Converting ER model Into Relational Table
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 5 Entity Relationship (ER) Modelling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Concepts and Terminology Introduction to Database.
Mapping from Data Model (ERD) to Relational Model
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
SQL Structured Query Language Programming Course.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
CS 370 Database Systems Lecture 9 The Relational model.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
Logical Database Design and Entity-Relationship Mapping “To Err is Human; to Forgive, Divine.” ~ Alexander Pope ~
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
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 Design Sections 11 Database relationship, Integrity, keys, mapping conceptual model to logical/physical model Previous Section 12 – DDLesson11Fa12.ppt.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
Database Design Sections 11 & 12 drawing conventions, generic model, integrity, keys, mapping conceptual model to logical/physical model.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
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.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 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.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
Lecture 4: Logical Database Design and the Relational Model 1.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
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.
Logical Database Design and the Rational Model
Chapter 4: Logical Database Design and the Relational Model
Chapter 4: Part B Logical Database Design and the Relational Model
Tables and Their Characteristics
Logical Data Modeling.
Database Management System
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Review of Week 1 Database DBMS File systems vs. database systems
DBMS ER-Relational Mapping
Mapping an ERD to a Relational Database
Presentation transcript:

Logical Database Design and Entity-Relationship Mapping “To Err is Human; to Forgive, Divine.” ~ Alexander Pope ~

What exactly is a Logical Model? A Blueprint of your database. It is DBMS independent, and does not rely on an specific product. It is a technical communications tool. Concepts from relational theory are re- introduced (PK, FK, Table, Column, data type) Any person knowledgeable in SQL should be able to read a logical model and create a real database implementation from it.

Concept Map: Conceptual vs. Logical CONCEPTUALLOGICAL ERDRelational Diagram EntityRelation (Table) AttributeColumn RelationshipForeign Key (FK) N/APK, Constraints Important: Rows (sample data) MUST be considered in the Logical Model !!!

Relational Notation is Simple Table or relation is a box. Name of relation is at the top. Columns / Attributes are placed below the relation name in the box. Primary Key columns are Underlined and labeled with PK Foreign Key columns are labeled with FK A PK/FK Relationship between tables are established with an arrow (  ), which always POINTS TO THE PRIMARY KEY of the relationship. SUID PK Lname Fname Ht Wt Students CardNo PK SUID FK CardType ExpDate CreditCards

Mapping Mapping is the process of transforming a conceptual model into a logical model.

Basic Attribute Mapping Table name is plural Use Naming conventions Assign data types PK for each table Break down composite into simple Set required to not null Set Unique and check constraints Conceptual Logical

Mapping 1-M Relationships FK goes on the many side If required on the one side (aka Weak Entity), then set the FK to not allow null Conceptual Logical

Mapping Multi-Valued Attributes Similar to 1-M: Place [m] attributes in new table. PK from original table is FK in the new table. Conceptual Logical

Mapping Multi-Valued Attributes Similar to 1-M: Place [m] attributes in new table. PK from original table is FK in the new table. Conceptual Logical

Mapping 1-1 Relationships Similar to 1-M: Since the FK goes to the optional side of the relationship, but the FK is set to PK. Conceptual Logical

Mapping M-M Relationships Make a “bridge table” place FKs in bridge table and set as composite PK Conceptual Logical

Mapping Weak Entities Make sure the foreign key does not allow null Conceptual Logical

Advanced Mapping Edge cases which are variations on the same themes. Examples provided for reference.

Ex: Mapping a Unary 1-M Relationship Conceptual Logical EmpID EName Phone HireDate Employee The FK inside the table forms the recursive relationship Manages EmpID PK EName Phone HireDate ManagerEmpID FK Employee

Ex: Mapping a Unary N-M Relationship Conceptual Logical ItemNo PK ItmName UnitCost Item Bridge Table with both FK’s relating back to the same table PK Contains ItemNo ItmName UnitCost Item ItemNo PK FK ComponentItemNo PK FK Qty Component

Ex: Mapping Sub/Super Type Conceptual Logical EmpNo EName HireDate Employee Discriminator HourlyRate EmpHourly AnnualRate StockOptns EmpSalary EmpNo PK EName HireDate EmpType Employee EmpNo PK FK HourlyRate EmpHourly EmpNo PK FK AnnualRate StockOptns EmpSalary

Logical Database Design and Entity-Relationship Mapping Questions?