1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.

Slides:



Advertisements
Similar presentations
Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
Advertisements

Logical Database Design
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.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Pertemuan Entity Relationship Diagram
Lecture Eleven Entity-Relationship Modelling
Methodology Logical Database Design for the Relational Model
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
1 Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design.
1 CS 3630 Database Design and Implementation. 2 Final Exam 7:00 – 8:52 PM, Thursday, May 16 Section 1: Ull 009 Section 2: Ull Points –50 points.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
LOGICAL DATABASE DESIGN
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Entity-Relationship Model
Relational Model & Relational Algebra. 2 Relational Model u Terminology of relational model. u How tables are used to represent data. u Connection between.
Chapter 5 Entity–Relationship Modeling
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
CSC271 Database Systems Lecture # 12. Summary: Previous Lecture  Row selection using WHERE clause  WHERE clause and search conditions  Sorting results.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
Chapter 9 Methodology - Logical Database Design Chapter 16 in Textbook.
Team Dosen UMN Database Design Connolly Book Chapter
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
CS 3630 Database Design and Implementation. 2 DreamHome Branch (branchNo, street, city, state, zipcode, phone1, phone2, phone3) Staff (staffNo, firstName,
CS 3630 Database Design and Implementation. 2 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
CS 3630 Database Design and Implementation. Assignment 1 2 What is 3630?
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 Data Modeling : ER Model…. Lecture Summary so for …. ER Model Entity, Attribute, Key Relationships Instance Diagram.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
1 Chapter 17 Methodology - Local Logical Database Design.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Entity Relationship Modeling
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
Database Systems – ER Diagrams EXAMPLE COMPANY DATABASE Requirements of the Company (oversimplified to illustrate) The company is organized into DEPARTMENTs.
Modelling Methodologies Chapter 16, 17, 18. Modeling Methodologies2 Database Design Physical DB design Logical DB design Conceptual DB design Hardware.
1 Database Systems Entity Relationship (E-R) Modeling.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 1.
CSC271 Database Systems Lecture # 23. Summary: Previous Lecture  Database design using ER modeling  Concepts of ER model  Entities  Relationships.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
Chapter 11 (2) CIS458 Sungchul Hong. Structural Constraints Main type of constraint on relationships is called multiplicity. Multiplicity - number (or.
DBMS ER model-2 Week 6-7.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
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.
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.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Teacher Workshop Database Design Pearson Education © 2014.
Chapter # 3 Data Modeling Using the Entity-Relationship (ER) Model
COP Introduction to Database Structures
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
The Relational Database Model
Conceptual Database Design
CS 3630 Database Design and Implementation
Entity-Relationship Modeling
Logical Database Design
Presentation transcript:

1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key

2 Candidate Key A minimum set of attributes that uniquely identifies each occurrence of an entity type. No proper subset satisfying the definition. Not minimum cardinality. R (Att1, Att2, Att3) Candidate Key: (Att1, Att2) Either Att1 or Att2 is not a candidate key But Att3 could be a candidate key An entity type could have more than one candidate key. Attributes of a candidate key cannot have null values.

3 Examples List the candidate keys for each table Branch (branchNo, street, city, state, zipcode) Owner (ownerNo, fName, lName, address, telNo) Viewing (clientNo, propertyNo, viewDate, comment)

4 Primary/Alternate Key Primary Key (PK) The candidate key that is selected to uniquely identify each occurrence of an entity type. Alternate key (AK) candidate key, but not primary key One entity type one PK zero or more AKs

5 Primary/Alternate Key Branch (branchNo, street, city, state, zipcode) PK: branchNo AK: street, city, zipcode Owner (ownerNo, fName, lName, address, telNo) PK: ownerNo AK: None Viewing (clientNo, propertyNo, viewDate, comment) PK: clientNo, viewDate AK: None

6 Simple and Composite Key Branch (branchNo, street, city, state, zipcode) Simple Owner (ownerNo, fName, lName, address, telNo) Simple Viewing (clientNo, propertyNo, viewDate, comment) Composite

7 Example Table Schema R (A, B, C) Table Instance A B C 100 x ct 200 y se 200 x cis Any candidate keys? Business rules. Part of table schema. Cannot be decided based on table instance only.

8 Diagrammatic Representation of Attributes Branch branchNo {PK} address … Branch branchNo Branch branchNo address … Only show the PKs in ER diagram.

9 Strong and Weak Entity Strong Entity not existence-dependent on other entity Weak Entity existence-dependent on other entity Business rules!

10 Strong and Weak Entity Patient patientNo name … Next_Of_Kin name phone … Has Strong entity Must have PK Parent Owner Dominant Weak entity May not have PK Child Dependent Subordinate

11 Structural Constraints Business Rules Participation Total (Mandatory) Partial (Optional) Cardinality Max number of occurrences that can be related to one occurrence Staff Oversees PropertyForRent

12 Structural Constraints: Multiplicity Combination of Participation and Cardinality Multiplicity of Binary Relationship one-to-one one-to-many many-to-many

13 Multiplicity: one-to-one Staff staffNo Branch branchNo Staff (1..1) Manages (0..1) Branch Each branch has exactly one manager. Each staff manages zero or one branch. For one object on the other side! Manages

14 Multiplicity: one-to-many Staff staffNo PropertyForRent propertyNo Staff (0..1) Oversees (0..*) PropertyForRent * For one object on the other side! One property is managed by 0 or 1 staff One staff manages 0 or more properties

15 Multiplicity: many-to-many NewsPaper newspaperName PropertyForRent propertyNo NewsPaper (0..*) Advertises (1..*) PropertyForRent 0..* 1..* For one object on the other side! One property is advertised on 1 or more newspapers One newspaper has Ads for 1 or more properties

16 Structural Constraints: Multiplicity Multiplicity of Complex Relationship (n-ary) When (n-1) values are fixed for other entities

17 Multiplicity for Complex Relationship BranchStaff Client Registers 0..* 0..1 Client (0..*) Registers with Staff (0..1) at Branch (0..1)