3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (E-R) Modeling Hachim Haddouti
Entity Relationship (ER) 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.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
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.
Entity Relationship (E-R) Modeling
Lecture Eleven Entity-Relationship Modelling
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Information Resources Management January 30, 2001.
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
Chapter 4 Entity Relationship (E-R) Modeling
Chapter Five Data Modeling with the Entity-Relationship Model.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Data Modeling Using the Entity-Relationship Model
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
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 
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Degree Indicates number of entities or participants.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Database Design – Lecture 4 Conceptual Data Modeling.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
TMC2034 Database Concept and Design
Entity-Relationship Model
Tables and Their Characteristics
Database Design – Lecture 4
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Review of Week 1 Database DBMS File systems vs. database systems
Conceptual Data Modeling Using Entities & Relationships
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relationship Diagram (ERD)
Mapping an ERD to a Relational Database
Entity Relation Model Tingting Zhang.
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other attributes Primary key (PK) is an attribute (or a combination of attributes) that uniquely identifies any given row –Composite key - Composed of more than one attribute Foreign key (FK) –An attribute whose values match primary key values in the related table Key’s role is based on determination –If you know the value of attribute A, you can look up (determine) the value of attribute B

3 & 4 2 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys (continued)

3 & 4 3 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys (continued)

3 & 4 4 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Types of Attributes Key attribute is a unique identifier Composite attribute can be subdivided Simple attribute cannot be subdivided Single-value attribute can have only a single value Multivalued attributes can have many values –A student may have more that one phone number; a home- phone number and a mobile-phone number Derived attribute’s value may be calculated (derived) from other attributes –Need not be physically stored in a database

3 & 4 5 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel EMPLOYEE is assigned to PROJECT M N Cardinality Connectivity

3 & 4 6 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Participation Optional participation –One entity occurrence does not require corresponding entity occurrence in particular relationship Mandatory participation –One entity occurrence requires corresponding entity occurrence in particular relationship

3 & 4 7 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Strength Weak (non-identifying) relationships –Exists if PK of related entity does not contain PK component of parent entity Strong (Identifying) Relationships –Exists when PK of related entity contains PK component of parent entity

3 & 4 8 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Weak (Non-Identifying) Relationships

3 & 4 9 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Strong (Identifying) Relationships

3 & 4 10 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Weak Entities Weak entity meets two conditions –Existence-dependent Cannot exist without entity with which it has a relationship –Has primary key that is partially or totally derived from parent entity in relationship Database designer usually determines whether an entity can be described as weak based on business rules

3 & 4 11 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Weak Entities (continued)

3 & 4 12 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Degree Indicates number of entities or participants associated with a relationship Unary relationship –Association is maintained within single entity Binary relationship –Two entities are associated Ternary relationship –Three entities are associated

3 & 4 13 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel EMPLOYEE is assigned to PROJECT is married to PERSON STUDENT student/teacher/subject relationship SUBJECT TEACHER Unary Binary Ternary

3 & 4 14 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Degree (continued)

3 & 4 15 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel A little about unary relationships Relationship between the rows of a single table is mother to PERSON ID YearofBirth NameMotherID

3 & 4 16 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Source: Mandatory participation 1, N, M

3 & 4 17 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Suggested Approach 1.Identify entities 2.Identify their attributes Determine key(s) Identify any composite multivalued derived 3.Identify relationships 4.Determine cardinality (1:1, 1:M, M:N) 5.Determine relationship participation mandatory optional 6.Determine weak entities (if any) Can the entity be identified using only its own attributes? If not, then it is a weak entity Weak entity’s key is underlined with a dashed line Weak entities participate in identifying relationships

3 & 4 18 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Practice... A database needs to be designed for the university student accommodation services. Each hall of residence has a number (unique), name (unique), address (street, city), phone, and the total number of rooms. Every hall contains single rooms only. Each room has a number (unique within a hall), and a weekly rent 28

3 & 4 19 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Practice... You are to design a database for a small library. The database needs to store data about various books the library holds. For each book, the database should record the book id (unique), title, publisher and the year of publication. A book may have several authors, and each author is represented by his/her name. A book typically has several copies. Each copy of a book is given a copy number. The availability of a book copy should be known, as well as the total number of copies. 24

3 & 4 20 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Practice … Design a database for a company. For each employee we store his/her name, tax number, address, salary, gender and birthdate. Some employees are supervised, and in those cases we keep track of the supervisee and supervisor. We want to keep track of the dependents of employees for insurance purposes. We keep each dependent's name, gender, birthdate and relationship to the employee who supports the dependent. 33