CMPT 355 Sept-Dec 2010 - w7d21 Example of Further Temporal Database Considerations Week 7, Day 2 based on last class.

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

Dimensional Modeling.
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.
Microsoft ® Access ® 2010 Training Create queries for a new database.
Data Flow Diagramming Rules Processes –a process must have at least one input –a process must have at least one output –a process name (except for the.
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
1 Class Agenda (04/03 and 04/08)  Review and discuss HW #8 answers  Present normalization process Enhance conceptual knowledge of database design. Improve.
Entity Relationship (ER) Modeling
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
E/R Exercises – Part I April 16, 2017.
Database Principles ER to RDM Mapping. Database Principles Mapping from ER to Relational Data Model the next phase Exercise: Give me some suggestions.
8 June Single table database in normal form Fields and records Normal form 1.Header in the first line 2.Same content for every field 3.Each record.
Design Principles: Faithfulness
Data modeling using the entity-relationship model Sept. 2012Yangjun Chen ACS Outline: Data modeling using ER-model (Chapter 3 - 3rd, 4th, 5th ed.)
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
Chapter 5 Normalization of Database Tables
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.
Dr Derek Peacock14/08/20151 Database Design 1:1 Relationships Dr Derek Peacock.
Mapping ERM to relational database
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
ZEIT2301 – Database Design Entity-Relationship Diagrams
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
1 Class Agenda (11/07 and 11/12)  Review HW #8 answers  Present normalization process Enhance conceptual knowledge of database design. Improve practical.
BUS1MIS Management Information Systems Semester 1, 2012 Access: Creating a Database Week 6 Lecture 2.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
More on relational databases, including 1 to 1, 1 to many and many to many relationships Please use speaker notes for additional information!
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Domain Modeling Part1: Entity Relationship Diagram Chapter 4 pp part 1 1.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
M1G Introduction to Database Development 2. Creating a Database.
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.
Constraints - primary and foreign keys in Oracle Please use speaker notes for additional information!
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Handling Many to Many Relationships. 2 Handling Many:Many Relationships Aims: To explain why M:M relationships cannot be implemented in relational database.
IBS 520 Introduction to Internet Technology Database Fundamentals Week 4.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Description and exemplification of entity-relationship modelling.
Database Beginnings CIS 121 – Computer Concepts II Instructor: Ron Christensen.
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.
Normalization of Database Tables
Exercise 1 Back to the Book-Publisher Database 1.
Database Design – Lecture 6 Moving to a Logical Model.
advanced data modeling
Database Systems: Design, Implementation, and Management Ninth Edition
Lection №4 Development of the Relational Databases.
Conceptual Design to Logical Design Lecture 4. Aims  To introduce Business Rules  To identify what a Business Rule is  To Introduce Business Operations.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Normalisation Unit 6: Databases. Just to recap  What is an Entity  What is an Attribute?
DECENTRALIZED TRAINING SEMINAR SESSION - I FUNDAMENTALS Facilities Planning and Scheduling Fall 2015 Sessions Banner 8.5 West Virginia University Facilities.
G057 - Lecture 05 From Scenario To Design Mr C Johnston ICT Teacher
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Let try to identify the conectivity of these entity relationship
Schedule of NTUST course selection 2017 Fall
eARS Release 2.0 Tips for AY 2014 File Upload
Primary Keys—Topics Uniqueness of Table Rows
Entity Relationship Diagram
Amazom.com “Product/Book Information Management Business Process”
ER Modeling Case Studies
Advanced Database Concepts: Reports & Views
Marvel College Appendix A.
Mapping an ERD to a Relational Database
Database Management system
Database Management system
Presentation transcript:

CMPT 355 Sept-Dec w7d21 Example of Further Temporal Database Considerations Week 7, Day 2 based on last class

CMPT 355 Sept-Dec w7d22 Derived Data (review) There are two classes of derived data –Static derived data is derived at some point in time and then remains constant –Dynamic derived data needs to change in synchronization with the data it is derived from With derived data –We might be loosing some data –that we might want sometime in the future.

CMPT 355 Sept-Dec w7d23 Temporal Data (Review) Is based on a new type of data –A period is composed of two values beginning bound – “the least value in a period” ending bound – “the greatest value in a period” We need one record per period –Where a period is the time frame over which the data (other than the ending bound) does not change –Each record will contain all the application relevant attributes (from the single record) a beginning and an ending bound –which will be used as part of the primary key of the record beginningending Known b-date NOT 0000 Unknown, current period e-date NULL Known b-date NOT 0000 Known, a previous period e-date NOT NULL

CMPT 355 Sept-Dec w7d24 A Still Better (preferred) Form Record order-class: –Class identification –Order date Record order-book: –Class identification –ISBN –Quantity –[order-book-price] Record book: –ISBN –b-date –e-date –Title –Author –Price To incorporate history: “total value of order” –can be derived from the book-price –for the order-date b-date becomes part of the book PK e-date isn’t needed in the key –as long as periods cannot overlap –(allowing it to have NULL values) However, it may still be useful to keep the order-book-price which is obviously redundant –(rather than hidden) this allows individual orders –to use special pricing on an order –which is different from the standard book-price.

CMPT 355 Sept-Dec w7d25 Another Example Let’s Consider U*STAR The objective of U*STAR is –to allow students –to register in classes –at the University of Saskatchewan We need to consider what it should do –(rather than what it does) To do this requires some analysis as well as some design

CMPT 355 Sept-Dec w7d26 The Starting Point From the University’s perspective we should start with: Classes (that have attributes:) –Class ID (the Primary Key) Department ID(there may be multiple ID’s / Department) Course number –Other stuff Class name Class description Class prerequisites –multiple (Class ID) (a recursive relationship)

CMPT 355 Sept-Dec w7d27 Guess What? Students don’t actually register in classes, –they register in: Sections (that have attributes:) –Section ID (the Primary Key) Class ID Section code (not always a number as we know) Term (NOTE: this is temporal stuff already!) –School Year –Term ID –Other stuff Class enrollment limit Time & Place –Multiple (day, time, location) Professor

CMPT 355 Sept-Dec w7d28 Guess What? But they don’t actually register in sections directly, –they register in class reference numbers: Sections (that have attributes:) –CRN(the Primary Key) –Other stuff Class ID Section code (not always a number as we know) Term (NOTE: this is temporal stuff already!) –School Year –Term ID Class enrollment limit Time & Place –Multiple (day, time, location) Professor

CMPT 355 Sept-Dec w7d29 Now for the Important Stuff And I don’t mean professors –(profs don’t rate our example or in U*STAR) Students (that have attributes:) –Student ID (the Primary Key) –Other stuff Name Address Phone College Department Year of studies

CMPT 355 Sept-Dec w7d210 How do students get into sections? We need to register them, which needs Registration (that have attributes:) –Student ID (part of the Primary Key) –CRN(part of the Primary Key) –Other stuff? Registration date(to track when this happened) Grade received(for completed classes) (should be used to check prerequisites (yah, right!))

CMPT 355 Sept-Dec w7d211 Now lets look what we have Classes –Class ID –Class name –Class description –Class prerequisites Sections –CRN –Section ID –Class enrollment limit –Time & Place –Professor Students –Student ID –Name –Address & Phone –College & Department & Year-studies Registration –Student ID –CRN –Registration date –Grade received What changes do we care about? We need to inspect our data structure to determine all potential changes that lead to possible temporal issues

CMPT 355 Sept-Dec w7d212 Considering Classes Classes –Class ID Department ID Course number –Class name –Class description –Class prerequisites Class –name, description, prerequisites may change We will want to know the real info for transcripts Thus we need to add a b-date and an e-date to classes –Class renumbering is a problem E.g. a few years ago 374 was renumbered to become 355 –and before that, 374 was numbered 441 This can easiest be handled by adding class equivalents to classes

CMPT 355 Sept-Dec w7d213 Considering Class Equivalents ClassEquivalents –Class ID Department ID Course number –Equivalent Class ID Department ID Course number –b-date –e-date Class Equivalents –Class IDs could be recycled after a time Thus we need to add a b-date and an e-date to classEquivalents

CMPT 355 Sept-Dec w7d214 Considering Sections Sections –CRN –Section ID Class ID Section code School year Term –Class enrollment limit –Time & Place –Professor Sections –are already somewhat temporal because they are based on a specific term in history –we don’t need to worry about changes to limits, locations, profs only the latest data –However we do need to be able to match up with the correct class record so we should add a start of term date as a non changeable, non key attribute

CMPT 355 Sept-Dec w7d215 Considering Students Students –Student ID –Name –Address –Phone –College –Department –Year of studies Students –Everything except student number may change –Changes in name, college, department, year can be important to note Thus we need to add a b-date and an e-date to students –We probably don’t need to worry about changes to address or phone But that’s just a processing choice, and won’t effect our database structure

CMPT 355 Sept-Dec w7d216 Considering Registrations Registration –Student ID –CRN –Registration date –Grade received Registration –what about a withdrawal date? We should add a withdrawal date to registrations –what about multiple registrations & withdrawals for a given section? If we don’t want to reuse pervious records and forget about this indecision This could produce multiple records with the same record key Unless we add registration date to the key of the record

CMPT 355 Sept-Dec w7d217 Further Temporal Considerations In the cases of classes and students –we have real entities, whose changes in attributes are important to remember In the case of sections –we have a real entity whose changes in attributes is not important to remember In the case of registrations –we have an entity representing a relationship whose changes in attributes are important to remember

CMPT 355 Sept-Dec w7d218 Further Temporal Considerations We always record real entities as records in a table –We use multiple records to record important to remember changes We don’t always record relationships as records in a table Often, relationships are based on –joins between tables of real entities –based on attributes in each of the tables However, to remember –the dates when changes in relationships occur –We must record the relationships in their own tables (just like where we need to record other attributes of a relationship) The table will include: –the primary keys of the two entities –beginning and ending dates for the relationship