CS 564 Database Management Systems: Design and Implementation

Slides:



Advertisements
Similar presentations
The Entity-Relationship Model
Advertisements

The Entity-Relationship (ER) Model
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Text-Book Chapters (7 and 8) Entity-Relationship Model
Databases Revision.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Modeling Your Data Chapter 2. Overview of Database Design Conceptual design: –What are the entities and relationships in the enterprise? – What information.
Lecture Eleven Entity-Relationship Modelling
Lecture 2: Entity/Relationship modelling
The Entity-Relationship (ER) Model CS541 Computer Science Department Rutgers University.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
SLIDE 1IS Fall 2002 Database Management: Discussion Session University of California, Berkeley School of Information Management and.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
1 Data Modelling Which data to include in the database.
Chapter 2: Entity-Relationship Model (Continued)
Modeling & Designing the Database
Database Design & ER Diagrams
CS 405G Introduction to Database Systems
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
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.
the Entity-Relationship Model
Entity-Relationship Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Entity-Relationship Model Ch. 3
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
Christoph F. Eick: Designing E/R Diagrams 1 The Entity-Relationship Model Chapter 3+4.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Slide content original, slide layout from Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
CS 564 Database Management Systems: Design and Implementation Lecture 2: Relational Model; ER to Relational Chapter 3 in Cow Book Slide ACKs: AnHai Doan,
©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.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Entity-Relationship Model
1 Data Modeling : ER Model…. Lecture Summary so for …. ER Model Entity, Attribute, Key Relationships Instance Diagram.
09/03/2009Lipyeow Lim -- University of Hawaii at Manoa 1 ICS 321 Fall 2009 Introduction to Database Design Asst. Prof. Lipyeow Lim Information & Computer.
1 Conceptual Design using the Entity- Relationship Model.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
1 Database Systems Entity Relationship (E-R) Modeling.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
Lecture 3 A short revision of ER and EER modelling See R. Elmasri, S.B. Navathe. Fundamentals of Database Systems (third edition) Addison-wesley. Chapter.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
Topic 3: ER – Entity Relationship Model (ERM) 6/12/
IT 5433 LM2 ER & EER Model. Learning Objectives: Explain importance of data modeling Define and use the entity-relationship model Define E/R terms Describe.
Modeling: Entity-Relationship Diagrams
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 17 July 28,2012 Data Modeling using the Entity Relationship.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
COP Introduction to Database Structures
MODELS OF DATABASE AND DATABASE DESIGN
Database Management Systems (CS 564)
Instructor: Elke Rundensteiner
The Entity-Relationship Model
The Entity-Relationship Model
Presentation transcript:

CS 564 Database Management Systems: Design and Implementation Arun Kumar Lecture 1: Entity-Relationship Modeling Chapter 2 in Cow Book Slide ACKs: AnHai Doan, Jeff Naughton, and Jignesh Patel

Database Design Process: ~6 steps Requirements Analysis Conceptual Database Design Logical Database Design Schema Refinement Physical Database Design Application and Security Design

Database Design Process: ~6 steps Requirements Analysis Conceptual Database Design Logical Database Design Schema Refinement Physical Database Design Application and Security Design Entity Relationship Modeling Relational Model and Normalization Indexing, etc.

ER Model Basics: Entity Entity: Distinguishable abstract real-world object An entity has several “Attributes” An attribute has a “Domain” A collection of similar entities is an “Entity Set” An entity set might have a “Key” attribute SID Name Age Student

ER Model Basics: Relationship Relationship: Association among ≥ 2 entities “Relationship Set” defined similarly SID Name Age DID Name Address Student Department Major EnrollDate

ER Model Basics: Relationship Set Mathematically, given entity sets A and B, a relationship set on A and B is a subset of A X B Student s2 s3 d2 d3 Department d1 s1 s4 Enroll relation: {(s1, d1), (s2, d1), (s3, d2), (s4, d3)}

Relationships in ER Multiple Relationships Multiplicity of Relationships Multi-way Relationships Self Relationships Multi-way to Binary Conversion

Multiple Relationships SID Name Age DID Name Address Major Student Department Advise Employ PID Name Age Professor

Multiplicity of Relationships b2 b3 b1 a1 a4 Student Department Many-to-one a2 a3 b2 b3 b1 a1 a4 Professor Department Many-to-many a2 a3 b2 b3 b1 a1 a4 Student Citizen One-to-one

Many-to-One and One-to-One in ER SID Name Age DID Name Address Major Student Department Arrow: Each Student appears at most once in Enroll, i.e., given a Student, the Department is unique (no double majors!) Student Name Age SID Citizen Address DID Match Q: How is Many-to-Many depicted?

The Cow Book denotes the above as follows: CAUTION: Difference with the Book SID Name Age DID Name Address Major Student Department The Cow Book denotes the above as follows: Student Name Age SID Department Address DID Major

Multi-way (n-ary) Relationships PID Name Age CID Name Credits Professor Course Teach Room DID Number Seats

Multi-way (n-ary) Relationships PID Name Age CID Name Credits Professor Course Teach Q: What does this mean? Room DID Number Seats

If “roles” are different, Self Relationships PID Name Age CID Name Credits Professor Course Teach PI Co-PI Collaborate Room DID Number Seats If “roles” are different, label the edges

Multi-way to Binary Conversion Professor Course Teach Professor Course Room InRoom ByProf OfCourse Teach Room Q: Why do we need these arrows?

Apart from types of Relationships, ER model can also capture Constraints

Constraints in ER Key: Uniquely identifies an entity Participation: Total or Partial Referential Integrity: Relationship “validity” Single-value Constraint Domain Constraints

Constraints: Key Student Room SID Name Age DID Number Seats Q: What does this mean?

Constraints: Participation Professor Name Age PID Department Address DID Employ Thick: Each Professor must appear at least once in Employ Student Name Age SID Department Address DID Major Q: So, what does this mean?

Constraints: Referential Integrity Professor Name Age PID Department Address DID Employ Curve: Each Professor must have a valid Department in Employ Student Name Age SID Department Address DID Major Q: So, what does this mean?

Advanced ER Concepts Weak Entities: an entity dependent on another Hierarchies: “Is a” relationships among entities

Advanced: Weak Entity PartOf Floor Department Number NumRooms DID Name Address PartOf Floor Department Thick/double lined shapes: Weak Entity and “dependency” DID and Number together are the Key for Floor Q. Why arrow, curve, and think line from Floor to PartOf? Q: Is a floor number ever meaningful without the Department?

Advanced: “Is A” Hierarchy Analogy: Sub-class Inheritance in PL SID Name Age Student IsA IsHonors QualScore Masters Undergrad Doctoral ByThesis

General ER Design Philosophy Follow Conventions Convey All App Constraints Avoid Redundancy Prefer Attributes over Trivial Entities

1. Follow Conventions Major Student Department Major Student

2. Convey All Application Constraints PID Name Age DID Name Address Employ Professor Department Q. What all constraints are missing here?

3. Avoid Redundancy Major Student Department SID Name Age DID Name Address Major Student Department DeptNAme

4. Prefer Attributes over Trivial Entities SID Name Age Name Major Student Department Q. What is wrong with the above? Student Name Age SID MajorDeptName

Review: ER Model Entity, Relationships Constraints Weak Entities; “IsA” Hierarchies Design Philosophy