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.

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
Systems Development Life Cycle
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 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
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
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
Chapter 5 Entity–Relationship Modeling
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
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.
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,
1 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 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
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.
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 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
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.
CS 3630 Database Design and Implementation. Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell.
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.
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.
IS 4420 Database Fundamentals Chapter 3: Modeling Data in the Organization Leon Chen.
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.
CS 3630 Database Design and Implementation
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
Tables and Their Characteristics
CS 3630 Database Design and Implementation
The Relational Database Model
CS 3630 Database Design and Implementation
Entity-Relationship Modeling
CS 3630 Database Design and Implementation
Presentation transcript:

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

3 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, Att4, Att5) 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.

4 List the Candidate Keys Branch (branchNo, street, city, state, zipcode) branchNostreetcitystatezipcode b0011 Main stMadisonWI53708 b01215 Washington stMadisonWI53708 b0511 Main stPlattevilleWI53818 ……………

5 List the Candidate Keys Owner (ownerNo, firstName, lastName, address, telNo) ownerNofirstNamelastNameaddresstelNo O101ScottSummers23 Moon Night, Platteville, WI, O203MikeRowe100 Madison, Platteville, WI, O318QiYang213 Ullrich, Platteville, WI, ……………

6 List the Candidate Keys Viewing (clientNo, propertyNo, viewDate, viewTime, comment) clientNopropertyNoviewDateviewTimecomment V100P10211/1/201410:00too large V221P20211/5/201311:30Expensive V100P10211/21/20142:15looks nice ……………

7 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 still unique One entity type one PK zero or more AKs

8 Primary/Alternate Key Branch (branchNo, street, city, state, zipcode) PK: branchNo AK: street, city, state, zipcode Owner (ownerNo, firstName, lastName, address, telNo) PK: ownerNo AK: None Viewing (clientNo, propertyNo, viewDate, viewTime, comment) PK: clientNo, viewDate, viewTime AK: propertyNo, viewDate, viewTime

9 Simple and Composite Key Branch (branchNo, street, city, state, zipcode) Simple Owner (ownerNo, firstName, lastName, address, telNo) Simple Viewing (clientNo, propertyNo, viewDate, viewTime, comment) Composite

10 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.

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

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

13 Strong and Weak Entity Patient patientNo Next_Of_Kin {PK?} Has Strong entity Must have PK Parent Owner Dominant Weak entity May not have PK Child Dependent Subordinate

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

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

16 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

17 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 Oversees

18 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 zero or more newspapers One newspaper has Ads for 1 or more properties Advertises

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

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

21 Assignment 3 Due Friday, Feb 13, beginning of class Do it with another student in the same section Sample E-R Model

Quiz1 Wednesday, Lab 206 Using Computers Open everything, but do it yourself! Download Word Document from D2L Upload Completed Document to D2L 22