IS 230Lecture 4Slide 1 Entity Relationship to Relational Model Mapping Lecture 5.

Slides:



Advertisements
Similar presentations
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Advertisements

Week 5 Relational Database Design by ER- -to-Relational Mapping.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Huiswerk Lees delen 3.2, 3.3 van hoofdstuk 3. opgaven voor hoofdstuk 2: modelleeropgave 5.
Mapping ER to Relational Model
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the.
CS370 Spring 2007 CS 370 Database Systems Lecture 6 Introduction to Database Design.
Text-Book Chapters (7 and 8) Entity-Relationship Model
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Database Management Systems I Alex Coman, Winter 2006 Entity-Relationship.
CS157A Lecture 3 ER Diagram Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Databases Revision.
Chapter 3: Relational Model
1 Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of an E-R Database.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Chapter 2: Entity-Relationship Model (Continued)
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Reduction of an E-R Schema to Tables A database which conforms to an E-R diagram can be represented.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Wat gaan wij leren? Data Bases Data modelleren  Hoe kan ik zien wat voor informatiesysteem.
Chapter 7 Relational Database Design by ER- and EER-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Entity-Relationship Model
Dr. Bernard Chen Ph.D. University of Central Arkansas
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to-Relational Mapping.
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
Database Design Concepts
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
Entity-Relationship Model
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- to-Relational Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
Chapter 3: Relational Model I Structure of Relational Databases Structure of Relational Databases Convert a ER Design to a Relational Database Convert.
Chapter 3: Relational Model  Structure of Relational Databases  Normal forms (chap. 7)  Reduction of an E-R Schema to Relational (Sect. 2.9)  Relational.
ICOM 5016 – Introduction to Database Systems Lecture 5b Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
CIS552Relational Model1 Structure of Relational Database Relational Algebra Extended Relational-Algebra-Operations Modification of the Database.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan Chapter 6: Entity-Relationship Model.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
1 Session 2 Welcome: The seventh learning sequence “ Reduction of an EER schema to tables“ Recap : In the previous learning sequence, we discussed the.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts DB Schema Design: the Entity-Relationship Model What’s the use of the E-R model? Entity Sets.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
ICOM 5016 – Introduction to Database Systems Lecture 9 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Entity Relationship Diagram (2)
Slide Chapter 7 Relational Database Design by ER- to-Relational Mapping.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
Databases Illuminated Chapter 3 The Entity Relationship Model.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Chapter 2 Entity-Relationship Model 2.1 IntroductionIntroduction 2.2 Basic conceptsBasic concepts 2.3 mapping constrainsmapping constrains 2.4 keyskeys.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
CS157A Lecture 4 ER Model 2 Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Lecture (8) 1. Relational Database Design by ER- and EERR- to-Relational Mapping 2.
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
Relational Database Design by ER- and EER-to-Relational Mapping
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Relational Database Design by ER- and EER-to-Relational Mapping
Entity-Relationship Model
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EERR-to-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Relational Database Design by ER- and EER-to-Relational Mapping
Session 2 Welcome: The seventh learning sequence
Chapter 6: Entity-Relationship Model
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

IS 230Lecture 4Slide 1 Entity Relationship to Relational Model Mapping Lecture 5

IS 230Lecture 4Slide 2 Relational Model  Structure of Relational Databases  Relation schema  Instances  keys  Translation of ER-model into Relational Model

IS 230Lecture 4Slide 3 1. Reduction of an E-R Schema to Tables Primary keys allow entities, relationships, and multiple attributes to be expressed uniformly as tables which represent the contents of the database. A database which conforms to an E­R diagram can be represented by a collection of tables. For each entity set and relationship set there is a unique table which is assigned the name of the corresponding entity set or relationship set. Each table has a number of columns (generally corresponding to attributes), which have unique names. Converting an E­R diagram to a table format is the basis for deriving a relational database design from an E­R diagram.

IS 230Lecture 4Slide Representing entity sets as tables A strong entity set reduces to a table with the same attributes. A weak entity set becomes a table that includes a column for the primary key of the identifying strong entity set. social-securityc-street Main North Main c-city Harrison Rye Harrison customer-name Jones Smith Hayes The customer table payment-numberpayment-date May May May 1996 payment-amount loan-number L-17 L-23 L-15 The payment table

IS 230Lecture 4Slide Representing entity sets as tables A many­to­many relationship set is represented as a table with columns for the primary keys of the two participating entity sets, and any descriptive attributes of the relationship set. The table corresponding to a relationship set linking a weak entity set to its identifying strong entity set is redundant. The payment table already contains the information that would appear in the loan­payment table (i.e., the columns loan­number and payment­number). social-securityaccount-numberaccess-date The depositor table … … …

IS 230Lecture 4Slide Determining Keys from E-R Sets Strong entity set. The primary key of the entity set becomes the primary key of the relation. Weak entity set. The primary key of the relation consists of the union of the primary key of the strong entity set and the discriminator of the weak entity set. Relationship set. The union of the primary keys of the related entity sets becomes a super key of the relation. For binary many-to-one relationship sets, the primary key of the “many” entity set becomes the relation’s primary key. For one-to-one relationship sets, the relation’s primary key can be that of either entity set. For many-to-many relationship sets, the union of the primary keys becomes the relation’s primary key

IS 230Lecture 4Slide Multivalued attributes An entity with a multivalued attribute gives an additional table, whose attributes are the multivalued attribute plus the primary key for the entity. The primary key for the relation is that of the entity or relationship set which has the attribute, along with the column holding individual values of the multivalued attributed. dependent-name Harrison Ford Bentsson Ford e-social-security 321­12­ ­28­ ­89­9011 The dependent table

IS 230Lecture 4Slide 8

IS 230Lecture 4Slide 9 Employee ERD DNUMBERDNAME RELATIONSHIPBDATESEXDEPENDENT_NAME DEPENDENT WORKS_ON PROJECT DEPT_LOCATIONS SUPERSSN MGRSTARTDATEMGRSSN DLOCATIONDNUMBER PLOCATIONPNUMBERPNAMEDNUM ESSN HOURS PNO ESSN SALARYSEXADDRESSBDATESSNLNAMEMINITFNAME EMPLOYEE DNO DEPARTMENT