Section 08 (a)ER Modelling In Practice1 HSQ - DATABASES & SQL And Franchise Colleges 08 (a) ER Modelling In Practice QUICKHIRE Car Company.

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Chapter 2.2 V3.0 Napier University Dr Gordon Russell
Organisation Of Data (1) Database Theory
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.
Post Exam Study Database Design
Section 09 (a)ER Modelling In Practice1 HSQ - DATABASES & SQL And Franchise Colleges 09 (a) ER Modelling In Practice DIGITAL VOICE SYSTEM.
Chapter 2.1 V3.1 Napier University Dr Gordon Russell
Section 09ER Decomposition Of Many To Many1 HSQ - DATABASES & SQL And Franchise Colleges 09 ER Decomposition of Many-to-Many.
Data Modeling (CB 12) CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
ENTITY RELATIONSHIP MODELLING
Section 07 (a)DFD to ERD Link1 HSQ - DATABASES & SQL By MANSHA NAWAZ 07 (a) - DFD to ERD Link And Franchise Colleges.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Revised by Ivor Perry Sept Introduction to Data Modelling.
M.S. Access Module CAS 133 Russ Erdman. M.S. Access Module Assignment Overview Two options for the unit: All students complete Units A, B and C In class.
ER Modelling III Example Digital Voice Systems Data Modelling Deriving Tables Types Mapping to SQL DDL.
Agenda for Week 1/31 & 2/2 Learn about database design
ISP 121 Week 1 Introduction to Databases. ISP 121, Winter Why a database and not a spreadsheet? You have too many separate files or too much data.
Lecture 10 Conversion to tables Database Design Concepts INFO1408.
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Database Design Concepts Info1408
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Database Design Concepts Lecture 7 Introduction to E:R Modelling Identifying Entities.
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Entity/Relationship Modelling
Practical tips for creating entity relationship diagrams (ERDs) Chitu Okoli Associate Professor in Business Technology Management John Molson School of.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
Driving School Database
BUS1MIS Management Information Systems Semester 1, 2012 Access: Creating a Database Week 6 Lecture 2.
Chapter 5 Entity Relationship (ER) Modelling
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
Database Design Principles – Lecture 3
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
IS 475/675 - Introduction to Database Design
1. Objectives At the end of this chapter you should be able to:  Discuss the use and features of a data model  Define the terms entity and attribute.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
A “Whack-The-Balls” session: Every Friday the manager of Whack-The-Balls arranges the playing sessions for the week beginning in 4 weeks time. At the same.
Btec National - Advanced Databases 1 Advanced Databases Entity Relationship Diagrams.
Section 11ER Tables1 HSQ - DATABASES & SQL And Franchise Colleges 11 ER Tables By MANSHA NAWAZ.
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.
G045 Lecture 08 DFD Level 1 Diagrams (Data Flow Diagrams Level 1)
Home Work. Design Principles and Weak Entity Sets.
Quiz questions. 1 A data structure that is made up of fields and records? Table.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
Database Design – Lecture 6 Moving to a Logical Model.
Mr C Johnston ICT Teacher
UFCEUS-20-2 : Web Programming
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Sample Table Standard Notation Entity name in uppercase
Btec National - IT SYSTEMS ANALYSIS AND DESIGN 1 IT Systems Analysis and Design Entity Relationship Diagrams.
1 CS 430 Database Theory Winter 2005 Lecture 3: A Fifty Minute Introduction to Data Modeling.
Hoi Le. Why database? Spreadsheet is not good to: Store very large information Efficiently update data Use in multi-user mode Hoi Le2.
Normalisation Unit 6: Databases. Just to recap  What is an Entity  What is an Attribute?
G057 - Lecture 05 From Scenario To Design Mr C Johnston ICT Teacher
Database Design Chapters 17 and 18.
Entity/Relationship Modelling
Let try to identify the conectivity of these entity relationship
Databases and Structured Files: What is a database?
Database Design Chapters 17 and 18.
Database Management system
Database Management system
Presentation transcript:

Section 08 (a)ER Modelling In Practice1 HSQ - DATABASES & SQL And Franchise Colleges 08 (a) ER Modelling In Practice QUICKHIRE Car Company

Section 08 (a)ER Modelling In Practice2 Case Study : QUICKHIRE Car Company A nationwide car hire company with depots and hirepoints in all major towns. The depots, where cars are held, are distinct from the hirepoints where the customer hires their car. One hirepoint has access to several depots and each depot may supply cars to many hirepoints. A unique employee number, name, address and telephone number. If the employee works at hirepoints a list of those hirepoints at which the employee may work should be available. Employees work either at hirepoints or at depots. Depot employees do not usually move but hirepoint employees frequently move from one hirepoint to another due to the seasonal nature of the trade. In addition, each hirepoint employee has a known set of hirepoints where they may be used (within travelling distance). Depot number, location, number of employees, a list of employees at the depot and a detailed list of cars currently held at each depot. The cars are identified by a unique number and should also have details of registration number, car type, colour, year of manufacture, number of miles travelled, date of last service, miles at last service. Hirepoints need a unique hirepoint number, name and location, a list of employees currently working at the hirepoints and a list of the depots a hirepoint may use. Each hiring is assigned a unique number and requires details of customer name, customer address and car numbers. A note is kept of the employee who did the hiring, date hired, and return date. Since a customer may be a company rather than an individual, provision is made for the possibility of more than one car being hired in an individual hiring. Each customer is assigned a unique number and many customers may have more than one hiring outstanding at the same time.

Section 08 (a)ER Modelling In Practice3 Where to start? The basic (simple entities) –Car –Hirepoint –Depot –Employee –Customer –Hiring Identifiers? Attributes? Definitions –Try to do these yourself.. reg#, car type, colour, year, miles_travelled, date _last_service, miles_last_service ….. (A physical car not Car_Type) hp#, address, name … A place where hirings are arranged. depot#, address … A place where cars are stored / serviced emp#, name, DOB, ….. (Works at Hirepoint or Depot..) cust#, address … A person or company who may hire a car hiring#, date, ….. A contract to hire a car or cars Note: Why not put hp#, cust#, car#, emp# in Hiring (yet)?

Section 08 (a)ER Modelling In Practice4 Where to start? Cont. Where is the money? –Which entity is a transaction of some kind - central to the business? Hiring ! Hiring Hirepoint at m 1 What can we link this to easily? A Hiring is at exactly 1 Hirepoint A Hirepoint may arrange 0,1,m Hirings How about Employee, and Customer - try to extend the ERD to include these. How about Hirepoint? –You try it.

Section 08 (a)ER Modelling In Practice5 Adding Employee and Customer From the scenario: Each hiring is assigned a unique number and requires details of customer name, customer address and car numbers. A note is kept of the employee who did the hiring, date hired, and return date. Hiring Hirepoint at m 1 to m 1 Customer by m 1 Employee What about cars? –Try to add this bit.

Section 08 (a)ER Modelling In Practice6 Cars... Each hiring is assigned a unique number and requires details of customer name, customer address and car numbers. A note is kept of the employee who did the hiring, date hired, and return date. Since a customer may be a company rather than an individual, provision is made for the possibility of more than one car being hired in an individual hiring. Hiring Car of m m How can you have a Hiring with no Cars? Would you allocate Cars immediately to a Hiring booked 3 weeks in advance? Could you have cancelled Hirings? Regular Hirings?

Section 08 (a)ER Modelling In Practice7 Decomposing the m:m Decompose this yourself …. Hiring Car of m m ?? ? m 1 Hiring ? m 1 Car What is the new entity?? Try Asymmetric Viewing. From left to right: –For a Hiring the new entity gives a list of all the Cars in that Hiring. From right to left: –For a Car the new entity give a list of all past Hirings it has been in (or any it has been assigned to in the future).

Section 08 (a)ER Modelling In Practice8 Attributes for the new entity. Try to think of some attributes for the new entity (A particular car in a particular hiring). –What would Quickhire need to record about the car before it is driven away? Miles_out, miles_in, condition_out, condition_in, fuel_out, fuel_in You may have others too. If you were sitting in one of the ‘things’ recorded by the new entity by the side of the road, what would you call it? A Hired Car ! ?? ? m 1 Hiring ? m 1 Car in m 1 Hiring is m 1 Car Hired Car

Section 08 (a)ER Modelling In Practice9 A Primary Key for Hired Car A reasonable guess for a Primary Key would be [ hiring#, reg# ] We need to test this out as in the lecture on complex entities. We will use the table type: hired_car(hiring#, reg#, miles_out, …...) Draw a table occurrence with three sensible rows yourself. in m 1 Hiring is m 1 Car Hired Car

Section 08 (a)ER Modelling In Practice10 Testing the hiring#, reg# Primary Key Now try to enter the first value of the Primary Key [H4, T125TGY] in a new row …. Use whatever you have in your example. –See if it makes sense to have a different mileage. Does this make any sense? –Can a car go out on the same hiring with two different mileages?? It looks like the Primary Key is probably valid.

Section 08 (a)ER Modelling In Practice11 The ERD so far... Notice we don’t have Depots yet. As we already have Employe we will continue with this aspect. in m 1 Hiring Hired Car to m 1 Customer by m 1 Employee is m 1 Car Hirepoint at 1 m

Section 08 (a)ER Modelling In Practice12 Employees A unique employee number, name, address and telephone number. If the employee works at hirepoints a list of those hirepoints at which the employee may work should be available. Employees work either at hirepoints or at depots. Depot employees do not usually move but hirepoint employees frequently move from one hirepoint to another due to the seasonal nature of the trade. In addition, each hirepoint employee has a known set of hirepoints where they may be used (within travelling distance). Try to fill in the degree of association an membership class for the diagram below. Employee Currently works at 1 m DepotHirepoint Works at 1 m Later we will find that both of these new relationships will require at table. Employee Currently works at DepotHirepoint Works at

Section 08 (a)ER Modelling In Practice13 Hirepoint Employees …. hirepoint employees frequently move from one hirepoint to another due to the seasonal nature of the trade. In addition, each hirepoint employee has a known set of hirepoints where they may be used (within travelling distance). Try to model this aspect... Employee Currently works at 1 m Hirepoint Employee Currently works at 1 m Hirepoint may work at m m Another m:m to decompose - an attribute of the new entity will be distance_from_home. Try to decompose this m:m relationship after the lecture and examine its primary key as before.

Section 08 (a)ER Modelling In Practice14 An almost complete ERD - for you to finish

Section 08 (a)ER Modelling In Practice15 Finishing off After the lecture you need to : –Determine the Primary key for the decomposition entity Employee_available_for_HP –Look at the decomposition entity HP_Depot_Access: Read about the original M:M relationship in the scenario. Find an attribute for the entity (something similar to the Employee_available_for_HP would do). Determine an appropriate primary key. –Find another relationship between Depot and Hired_Car. –Work out how the relationship between Car and Depot relates to the scenario. –In another session, try to draw the whole ERD just from the scenario & memory. Don’t forget the primary keys of m:m relationships. You may find you need to sneak a look at a slide sometimes.

Section 08 (a)ER Modelling In Practice16 End of Lecture