E/R Exercises – Part I April 16, 2017.

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

ER Modeling Case Studies
Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that.
Database Design The process of finding user requirement
Conceptual Design using the Entity-Relationship Model
ER Modeling Case Studies
Constraints in Entity-Relationship Models Zaki Malik September 18, 2008.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
The Entity-Relationship Model
Entity-Relationship Models
1 The Entity-Relationship Model Chapter 2. 2 Exercise  What can you say about policy of the bank from the ER diagram?  What can you say about the policy.
The Entity-Relationship (ER) Model
IELM 511: Information System design Introduction Part I. ISD for well structured data – relational and other DBMS Part II. ISD for systems with non-uniformly.
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.
Entity Relationship (ER) Modeling
Entity - Relationship Modelling Exercises by Artem Chebotko
Design Principles: Faithfulness
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.) –What are the entities.
The (min,max) notation (1,1) (0,1) (1,N) (1,1). SUMMARY OF ER-DIAGRAM NOTATION FOR ER SCHEMAS Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING.
Compe 301 ER - Model. Today DBMS Overview Data Modeling Going from conceptual requirements of a application to a concrete data model E/R Model.
Chapter 2 Modeling Data in the Organization
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
ER Modeling Case Studies
Data Modeling Using the Entity-Relationship Model
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design : (ER Model is used at this stage.)  What are the entities.
Instructor :Huda Al-Omair
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
Slide content original, slide layout from Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Database Design 3: Advanced Data Modeling Concepts CS 320.
The Hong Kong University of Science and Technology COMP3311 Spring 2013 Tutorial 1 ER Diagrams.
COMP231 Tutorial 1 ER Model and ER to Relational Schema.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 2 Introduction to a First Course in Database Systems.
1 Conceptual Design using the Entity- Relationship Model.
Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets.
advanced data modeling
Practice of ER modeling Yong Choi School of Business CSUB.
MIS2502: Data Analytics Relational Data Modeling
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
Entity/Relationship Modelling. Entity Relationship Modelling In This Lecture Entity/Relationship models Entities and Attributes Relationships Attributes.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003, 2004,
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
ER & Relational: Digging Deeper R &G - Chapters 2 & 3.
Introduction to Database Systems
Howard Paul. Sequential Access Index Files and Data File Random Access.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
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.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Entity-Relationship Data Model
Entity Relationship (E-R) Model
Entity/Relationship Modelling
The Entity-Relationship Model
Case Studies: Data Modeling
ER Diagram Practical Example
Database EER.
Entity – Relationship Model
Data Modeling with Entity Relationship Diagrams (Cont.)
MIS2502: Data Analytics Relational Data Modeling
Example A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites;
Database Modeling using Entity Relationship Model (E-R Model)
CS4222 Principles of Database System
ER Modeling Case Studies
Question Which of the following plays an important role in representing information about the real world in a database? Explain briefly 1)DDL.
MIS2502: Data Analytics Relational Data Modeling 2
Entity-Relationship Data Model
Presentation transcript:

E/R Exercises – Part I April 16, 2017

Database Design Sequence

Review Entity set Weak entity set Relationship set Weak relationship set Attribute Multiplicity of relationships Referential integrity

Different Sets of Notations Two different sets of ER notations are commonly used. One from Ullman’s book as shown on the last slide Another from Ramakrishnan’s book with main differences in: - arrow always pointing to “relationship”; - notations of partial or total participation constrains; - notation of aggregations.

Exercise #1 - 1 A database for a bank includes information about customers and their accounts. Information about customer includes name, address, phone, and social security number. Accounts have numbers, type (saving, checking), and balances. An account can be owned by several customers, and a customer can have multiple accounts.

Exercise #1 - 2 number type balance Customer Account SSN name address phone own

Exercise #2 Change your design so that an account can have exactly one customer number type balance Account own Customer SSN name address phone

Exercise #3 Further change your design so a customer can have at most one account number type balance Customer SSN name address phone Account own

Exercise #4 - 1 Change your original design so that a customer can have a set of addresses (street, city, state) and a set of phones. Remember that we do not allow non-atomic types for attributes.

Exercise #4 - 2 street city Address Phone number state number type Lives at has number type balance name Customer own Account SSN

Exercise #5 - 1 Further change your original design so that a customer can have a set of addresses. Also, at each address, there is a set of phones.

Exercise #5 - 2 street city Address Phone number has state name number Lives at name number type balance Customer own Account SSN

Exercise #6 - 1 Design a database for a university registrar. This database should include information about students, departments, professors, courses, which student are enrolled in which courses, which professors teach which courses, student grades, TA for the course (TAs are students), which courses a department offers, and any other information you deem appropriate.

Exercise #6 – Solution #1 position EID semester section section tutor of teaches Professor hired semester TA grade semester section Student enroll Course offer Department number name credit name name address phone id Is this a good design? OK, but not a good design. “semester” and “section” appear in several relationships -> Can’t guarantee the consistency of DB easily

Exercise #6 – Solution #2 position EID Professor TA section semester hired TA section semester Student isIn Course offer Department grade number name credit name name address phone id Is this a good design? No. Lots of redundancy (in “isIn”), although the E/R diagram itself looks simpler

Exercise #6 – Solution #3 position EID Professor TA grade section tutor of teaches Professor hired TA grade section semester Student enroll Course offer Department number name credit name name address phone id This solution has less redundancy comparing to the previous 2. But redundancy still exists in “Course”. Is this a good design?

Exercise #6 – Solution #4 position EID Professor semester TA Available tutor of teaches Professor hired semester TA Available Course section Student enroll Course offer Department grade number name credit name name address phone id Is this a good design? Yes!