In this session, you will learn to: Map an ER diagram to a table Objectives.

Slides:



Advertisements
Similar presentations
Week 5 Relational Database Design by ER- -to-Relational Mapping.
Advertisements

Relational Database Design Via ER Modelling
Database Systems: Design, Implementation, and Management Tenth Edition
Advanced Data Modeling
Entity Relationship (ER) Modeling
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.
Systems Development Life Cycle
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 6 Advanced Data Modelling
Concepts of Database Management Sixth Edition
© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter Five Data Modeling with the Entity-Relationship Model.
Concepts of Database Management Seventh Edition
Database Systems: Design, Implementation, and Management Tenth Edition
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
The Relational Database Model
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.
Database Design Concepts
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Concepts and Terminology Introduction to Database.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Databases. Not All Tables Are Created Equal Spreadsheets use tables to store data and formulas associated with that data The “meaning” of data is implicit.
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
Jozef Kuper.  Describe a Database  Entities  Atributes  Relationships.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model.
©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
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.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
IT 5433 LM2 ER & EER Model. Learning Objectives: Explain importance of data modeling Define and use the entity-relationship model Define E/R terms Describe.
Lecture 5 Data Model Design Jeffery S. Horsburgh Hydroinformatics Fall 2012 This work was funded by National Science Foundation Grant EPS
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Data Modeling Using the Entity- Relationship (ER) Model
Logical Database Design and the Rational Model
Relational Database Design by ER- and EER-to- Relational Mapping
Relational Database Design by ER-to-Relational Mapping
CSCI-100 Introduction to Computing
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
DBMS ER-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

In this session, you will learn to: Map an ER diagram to a table Objectives

Reflects entities and their relationships, based on the data processing needs of an organization Can be mapped to a relational, hierarchical, or network model Is independent of individual applications, database management systems, hardware, and physical storage of data Conceptual Model

A database that conforms to an ER diagram can be represented by a collection of tables in the relational system. The mapping of ER diagrams to tables can be discussed in relation to the following: Regular entities Attributes Relationships Weak entities Subtypes and Supertypes Mapping ERDs to Tables

They can exist in isolation, independent of any other entity. They are the “building blocks” of the database. Each regular entity maps to a table. Regular Entities

Each property or attribute shown in the ER diagram maps to a column in the appropriate table. Attributes

Each type of relationship maps to tables in a different manner in the relational database management system. The most important principle is to create tables where information from the real world is stored and retrieved in an optimal way; that is, a minimum number of tables with a minimum number of attributes. In a relational system, a join operation retrieves all information by combining two or more tables. Are of the following types: One-to-One One-to-Many Many-to-Many Relationships

A weak entity is an entity whose existence depends on some other entity. It cannot exist if the entity on which it depends does not exist. Weak Entities

Each entity type (subtypes and supertypes) maps to a separate table. The primary key of the supertype is the foreign key of the subtype: It creates a link between the two. The foreign key of the subtype is also its primary key. Subtypes and Supertypes

Attributes: Do not introduce any unnecessary attributes. An attribute serves three purposes: To identify its owner entity To refer to another entity To simplify the description of an entity Keys: Relational systems require keys that uniquely identify the rows of a table. There are various types of keys: Primary Foreign Candidate Alternate Composite Tips on Logical Database Design

Any attribute (or set of attributes) that uniquely identifies a row in a table is a candidate for the primary key. Such an attribute is called a candidate key. Any attribute that is a candidate for the primary key but is not the primary key is called the alternate key. Keys can be simple or composite: A simple key is composed of a single attribute. A composite key, on the other hand, comprises two or more attributes. Tips on Logical Database Design (Contd.)

Just a minute Define the following terms: 1.Candidate Key 2.Alternate Key Answer: 1.Any attribute (or set of attributes) that uniquely identifies a row in a table is a candidate for the primary key. Such an attribute is called a candidate key. 2.Any attribute that is a candidate for the primary key but is not the primary key is called the alternate key.

Tips on Logical Database Design (Contd.) Entities: Some attributes may acquire further attributes during database design and become entities. Subentities: Replace optional attributes of an entity with subentities. This is called specialization. Specialization is the result of taking a subset of a higher-level entity set to form a lower-level entity set. Generalization is the result of taking the union of two or more lower-level entity sets to produce a higher ‑ level entity set.

Problem Statement Map the ER diagram to its corresponding tables. Demo: Mapping the ER Diagram to Tables

In this session, you learned that: The conceptual model reflects entities and their relationships. Data analysis helps determine entities and relationships. The conceptual model is independent of the system where it is to be implemented. Regular entities are not dependent. They can exist in isolation, independent of any other entity. Each entity maps to a table. Each attribute in an E/R diagram maps to an attribute in a table. Entities with common attributes should be merged. Attributes may acquire further attributes and become entities. The mapping of relationships depends on the type of relationship. Each type of relationship maps to tables in a different manner in the relational database management system. Summary

In one-to-one relationships, one instance of an entity can relate to only one instance of the related entity. In a one-to-many relationship, one instance of an entity can relate to more than one instance of the related entity. Many-to-many relationships map to tables. One-to-one relationships are not very common and may map to foreign keys in tables. A weak entity is an entity whose existence depends on some other entity. A subtype is a subset of another entity. A subtype is always dependent on supertype for its existence. The primary key of the supertype is the foreign key of the subtype. It creates a link between the two. Summary (Contd.)

A candidate key is a candidate for the primary key. An alternate key is a candidate key that is not a primary key. Optional attributes should be replaced with subentities; this is also called specialization. To simplify multiple references, a new superentity should be introduced; this is also called generalization. Summary (Contd.)