Exercise 1 Back to the Book-Publisher Database 1.

Slides:



Advertisements
Similar presentations
Banking Business Scenario
Advertisements

ER Model For a college DB
Entity Relationship Diagrams
Database Design (1) IS 240 – Database Management Lecture #10 – Prof. M. E. Kabay, PhD, CISSP Norwich University
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.
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
CMPT 355 Sept-Dec w7d21 Example of Further Temporal Database Considerations Week 7, Day 2 based on last class.
ER Modeling Case Studies
Entity, Attribute, and Relationship DATA ENTITY TYPE: a noun, i.e. roles, events, locations, people, tangible things about which we wish to maintain.
Entity-Relationship Models
CS370 Spring 2007 CS 370 Database Systems Lecture 6 Introduction to Database Design.
E/R Exercises – Part I April 16, 2017.
Weak Entity Sets. Occasionally, entities of an entity set need “help” to identify them uniquely. Example. Crews might have a number and some description,
Weak Entity Sets. Occasionally, entities of an entity set need “help” to identify them uniquely. Entity set E is weak if in order to identify entities.
Conceptual Models Agenda - Steps in the design of a DB - Need for conceptual models - The Entity-Relationship Model (ER-Model)
From ER Diagrams to the Relational Model Rose-Hulman Institute of Technology Curt Clifton.
ER Modeling An E-R model is a conceptual (or logical) data model that includes –Entity (classes) –Attributes of each entity –Relationship types between.
The Entity-Relationship Data Model
SLIDE 1IS Fall 2002 Database Management: Discussion Session University of California, Berkeley School of Information Management and.
Relational Data Analysis II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos E-R diagrams.
Database – Part 2a Dr. V.T. Raja Oregon State University.
Case study Lisa’s Bookstore IST210.
Mapping ERM to relational database
Database Systems Lecture 5 Natasha Alechina
Entity-Relationship modeling Transparencies
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.
Overview of Database Development
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
ER Modeling Practice Exercise Solutions MBA 8473.
Instructor :Huda Al-Omair
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
The DM Process – MS’s view (DMX). The Basics  You select an algorithm, show the algorithm some examples called training example and, from these examples,
Assignements. CSC343: Intro. to Databases2 Exercise 1 Superkeys: Candidate keys: Primary key:
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
Lecture 7 of Advanced Databases
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
Section 08 (a)ER Modelling In Practice1 HSQ - DATABASES & SQL And Franchise Colleges 08 (a) ER Modelling In Practice QUICKHIRE Car Company.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 4 Mapping an ER model to tables © Akhilesh Bajaj,
CS3431: C-Term The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
IE 423 – Design of Decision Support Systems Database development – Building Tables
1 The Information School of the University of Washington Dec 1fit advdatabases © 2006 University of Washington Advanced Database Concepts INFO/CSE.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Normalization Exercise. First Normal Form Second Normal Form.
Btec National - Advanced Databases 1 Advanced Databases Entity Relationship Diagrams.
 An entity-relationship diagram (ERD) is a specialized graphic that illustrates the interrelationships between entities in a database.
E-R to Relational - Basic
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.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
Data Flow Diagrams CP1 Computing.
Database Design – Lecture 6 Moving to a Logical Model.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
INTRODUCTION TO DATA MODELING CS 260 Database Systems.
Database Design – Lecture 7
The Entity-Relationship Model
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh Part-3.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
Btec National - IT SYSTEMS ANALYSIS AND DESIGN 1 IT Systems Analysis and Design Entity Relationship Diagrams.
COMP 430 Intro. to Database Systems Entity-Relationship Diagram Basics Slides use ideas from Chris Ré.
Data Modeling AND ER MODELS.
A short revision on entity- relationship modelling.
A short review on entity- relationship modelling.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
Year 12 > 13 Applied GCE ICT Unit 7 Using Database Software.
CCT395, Week 5 Translating ER into Relations; Normalization This presentation is licensed under Creative Commons Attribution License, v To view a.
Translating ER into Relations; Normalization
COP Introduction to Database Structures
HOTEL ADDRESS, CITY, STATE & ZIP
Presentation transcript:

Exercise 1 Back to the Book-Publisher Database 1

Recall the Scenario 2

Book-Publisher DB 3 What remains is the “Contracts” and their details

Book-Publisher DB 4 We modeled the contract between “Authors” & “Publishers” We made the contract “date” part of the key  now an author can have multiple contracts with the same publisher over time. What about contract lines ???

Book-Publisher DB 5 This means a contract has only one line

Book-Publisher DB 6 Not in the ER standards

Book-Publisher DB 7

Exercise 2 Design Hotel database 8

Example: Hotel Database A Hotel has many branches Hotel  name, logo, address of HQ, Tel., manager, star rating Branch  Id, address, Tel., Total capacity Each branch has many rooms with different types and numbers. A room type defines Room size, Number of beds Has TV or not, Has Balcony or not These attributes of the room depend on its type Guests can stay in a hotel for a period of time Guests have unique ID, name, address, Tel. We need to capture, the length of the stay, start date, end date, money paid 9

10 Hotel Name HQ Add.Manager Rating Tel. Branch ID Add. Tel. Capacity Room Num Type Num Beds Capacity Has TV Has Balcony Ver. 1 Observations: Room type is modeled as attribute (causes redundancy) Room number, is it numeric like 1001? If so, how come to be unique across branches?

11 Hotel Name HQ Add.ManagerRatingTel.BranchIDAdd.Tel.CapacityType Num BedsCapacityHas TVHas Balcony Ver. 2 Observations: Lets add relationships RoomNum

12 Hotel Name HQ Add.ManagerRatingTel.BranchIDAdd.Tel.CapacityType Num BedsCapacityHas TVHas Balcony Ver. 3 RoomNum has Of type contains Common mistake: Do not add “Branch ID” as an attribute to “Room” entity set. It is already captured by the weak relationship “contains”. Observation: Not all relationships of “Room” are “supporting” relationships. Only the one that completes my key.

Back to the Requirements A Hotel has many branches Hotel  name, logo, address of HQ, Tel., manager, star rating Branch  Id, address, Tel., Total capacity Each branch has many rooms with different types and numbers. A room type defines Room size, Number of beds Has TV or not, Has Balcony or not Guests can stay in a hotel for a period of time Guests have unique ID, name, address, Tel. We need to capture, the length of the stay, start date, end date, money paid 13

14 Hotel Name HQ Add.ManagerRatingTel.BranchIDAdd.Tel.CapacityType Num BedsCapacityHas TVHas Balcony Ver. 4 RoomNum has Of type contains Guest ID Add. Tel. Name Money Paid Length of stayStart date End date Observations: “Stay” attributes should not be part of “Guest”

15 Hotel Name HQ Add.ManagerRatingTel.BranchIDAdd.Tel.CapacityType Num BedsCapacityHas TVHas Balcony Ver. 5 RoomNum has Of type contains Guest ID Add. Tel. Name Money Paid Length of stay Start date End date Stays in Observations: Still not quite right.. “Stays-in” 1-M or M-M?? (Guest should be able to stay in diff. rooms)

16 Hotel Name HQ Add.ManagerRatingTel.BranchIDAdd.Tel.CapacityType Num BedsCapacityHas TVHas Balcony Ver. 6 RoomNum has Of type contains Guest ID Add. Tel. Name Money Paid Length of stay Start date End date Stays in Observations: Not done yet… In this model, a guest cannot stay in the same room over diff visits!!!

17 Hotel Name HQ Add.ManagerRatingTel.BranchIDAdd.Tel.CapacityType Num BedsCapacityHas TVHas Balcony Ver. 7 RoomNum has Of type contains Guest ID Add. Tel. Name Money Paid Length of stay Start date End date Stays in Observations: Start_date  part of key Length of stay  derived attribute