IS 325 Notes for Wednesday September 18, 2013.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Relational Database Design Via ER Modelling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
1 Logical Database Design and the Relational Model Modern Database Management.
Systems Development Life Cycle
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 3: Modeling Data in the Organization
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) 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.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Chapter 3: Modeling Data in the Organization
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
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 3: Modeling Data in the Organization
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
Concepts and Terminology Introduction to Database.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
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.
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 Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
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.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
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.
Chapter 3: Modeling Data in the Organization
Data Modeling Using the Entity- Relationship (ER) Model
Logical Database Design and the Rational Model
Entity- Relationship (ER) Model
Chapter # 3 Data Modeling Using the Entity-Relationship (ER) Model
Relational Database Design by ER- and EER-to- Relational Mapping
Chapter 4 Logical Database Design and the Relational Model
Chapter 4: Logical Database Design and the Relational Model
Chapter 4: Part B Logical Database Design and the Relational Model
Chapter 5: Logical Database Design and the Relational Model
Tables and Their Characteristics
Database Design – Lecture 4
CMPE 226 Database Systems February 21 Class Meeting
CS 174: Server-Side Web Programming February 12 Class Meeting
Relational Database.
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Data Modeling for Database Design 2
Database Modeling using Entity Relationship Model (E-R Model)
Review of Week 1 Database DBMS File systems vs. database systems
CHAPTER 2 - Database Requirements and ER Modeling
CS4222 Principles of Database System
Presentation transcript:

IS 325 Notes for Wednesday September 18, 2013

Homework Grades/Feedback I’m behind on homework.. I will catch-up this weekend

Today’s Class Periodically you might need to be reminded why you are here Why It's Important to Know Computer Programming The World is Flat

MAPPING UNARY RELATIONSHIPS Unary relationships in ER diagrams are mapped in the same way as binary relationships

MAPPING UNARY RELATIONSHIPS Mapping 1:M unary relationships The relation mapped from an entity involved in a 1:M unary relationship contains a foreign key that corresponds to its own primary key

MAPPING UNARY RELATIONSHIPS Mapping a 1:M unary relationship Client can be referred by only one client but can refer multiple clients Sample data records for the mapped relation

MAPPING UNARY RELATIONSHIPS Mapping M:N unary relationships In addition to the relation representing the entity involved in a unary M:N relationship, another relation is created to represent the M:N relationship itself This new relation has two foreign keys, both of them corresponding to the primary key of the relation representing the entity involved in the unary M:N relationship Each of the foreign keys is used as a part of the composite primary key of the new relation

MAPPING UNARY RELATIONSHIPS Mapping a M:N unary relationship Sample data records for the mapped relations

MAPPING UNARY RELATIONSHIPS Mapped in the same way as 1:M unary relationships

MAPPING UNARY RELATIONSHIPS Mapping a 1:1 unary relationship Sample data records for the mapped relation

MAPPING MULTIPLE RELATIONSHIPS BETWEEN THE SAME ENTITIES Each relationship is mapped

MAPPING MULTIPLE RELATIONSHIPS BETWEEN THE SAME ENTITIES Sample data records for the mapped relations

MAPPING WEAK ENTITIES Mapping weak entities Weak entities are mapped in a same way as regular entities with one addition: The resulting relation has a composite primary key that is composed of the partial identifier and the foreign key corresponding to the primary key of the owner entity

MAPPING WEAK ENTITIES Mapping a weak entity Sample data records for the mapped relations

MAPPING WEAK ENTITIES Mapping a weak entity with two owners Sample data records for the mapped relations

MAPPING WEAK ENTITIES Mapping a weak entity with no partial identifier Sample data records for the mapped relations

Example ER diagram : HAFH Realty Company Property Management Database

Example mapped relational schema: HAFH Realty Company Property Management Database

Example: Sample data records for the HAFH Realty Company Property Management Database (part 1)

Example: Sample data records for the HAFH Realty Company Property Management Database (part 2)

RELATIONAL DATABASE CONSTRAINTS Relational database constraints - rules that a relational database has to satisfy in order to be valid Implicit constraints The implicit relational database model rules that a relational database must satisfy in order to be valid User-defined constraints Database constraints that are added by the database designer

RELATIONAL DATABASE CONSTRAINTS Implicit constraints Each relation in a relational schema must have a different name Each relation must satisfy the following conditions: Each column must have a different name Each row must be unique In each row, each value in each column must be single valued Domain constraint - all values in each column must be from the same predefined domain The order of columns is irrelevant The order of rows is irrelevant

RELATIONAL DATABASE CONSTRAINTS More Implicit constraints Primary key constraint - each relation must have a primary key, which is a column (or a set of columns) whose value is unique for each row Entity integrity constraint Referential integrity constraint

RELATIONAL DATABASE CONSTRAINTS User-defined constraints Added by the database designers

RELATIONAL DATABASE CONSTRAINTS Specific minimum and maximum cardinalities Sample data records for the mapped relations

RELATIONAL DATABASE CONSTRAINTS Business rules User defined constraints that specify restrictions on databases that are not a part of the standard notation for creating ER diagrams

RELATIONAL DATABASE CONSTRAINTS Business rule for salary amounts Sample data records for the mapped relation

RELATIONAL DATABASE CONSTRAINTS Business rule for the dates of enrollment and graduation Sample data records for the mapped relation

RELATIONAL DATABASE CONSTRAINTS Business rule for gender of students in an organization Sample data records for the mapped relation

MAPPING ASSOCIATIVE ENTITIES Associative entities are mapped into relational database constructs in the identical way as M:N relationships

Example: An M:N relationship and associative entity mapped into a relation in the same way

MAPPING TERNARY RELATIONSHIPS Ternary relationships are used as many-to-many-to-many relationships A new relation is created with foreign keys from the participating entities forming a composite primary key of the new relation

Example: Mapping a ternary relationship

Example: Sample data records for the mapped relations

DESIGNER-CREATED PRIMARY KEYS AND THE AUTONUMBER OPTION Autonumber data type option - enables automatic generation of consecutive numeric data values in a column Designer-created primary key - primary key column, not called for by the original requirements, added to a table by the database designer Often used in conjunction with the autonumber data type option

DESIGNER-CREATED PRIMARY KEYS AND THE AUTONUMBER OPTION Entity and the resulting relation with a designer-created primary key column Entity and the resulting relation Sample data records for the relation with a designer-created primary key

ER AND RELATIONAL MODELING Process of requirements collection should be accompanied by the ER modeling and then followed by mapping the ER model into a subsequent relational schema Some practitioners prefer to create relational schemas straight from the requirements In such cases, the ER modeling phase is simply omitted

ER AND RELATIONAL MODELING Create relational schemas straight from the requirements is not advisable for following reasons ER modeling is more suited for visualization of the requirements Certain concepts can be visualized graphically only in ER diagrams Every attribute is mentioned only once in the ER diagram An ER model is a better communication and documentation device