SPECIAL PURPOSE DATABASES 13/09/14371. Temporal Database Concepts  Time is considered ordered sequence of points in some granularity Use the term choronon.

Slides:



Advertisements
Similar presentations
TSQL 2 : QUERY LANGUAGE FOR TEMPORAL DATA CS 224 : Advanced Topics in Data Management.
Advertisements

TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Relational Database Design UNIT II 1. 2 Advantages of Using Database Systems Centralized control of a firm’s data Redundancy can be reduced (avoid keeping.
Advanced Databases Temporal Databases Dr Theodoros Manavis
Time in Databases CSCI 6442 With thanks to Richard Snodgrass, 1985 ACM /85/005/0236.
Ch 10, Functional Dependencies and Normal forms
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Databases and Processing Modes. Fundamental Data Storage Concepts and Definitions What is an entity? An entity is something about which information is.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
Aims and Objectives In this session you will be able to: Define ELHs and describe why they are used in systems analysis. Recognise the structure of an.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Information Storage and Retrieval CS French Chapter 3.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
N. J. Taylor Database Management Systems (DBMS) 1.
1.A file is organized logically as a sequence of records. 2. These records are mapped onto disk blocks. 3. Files are provided as a basic construct in operating.
CS 380 Introduction to Database Systems (Chapter 5: The Relational Data Model and Relational Database Constraints)
DATABASE MANAGEMENT SYSTEMS BASIC CONCEPTS 1. What is a database? A database is a collection of data which can be used: alone, or alone, or combined /
DATABASE MANAGEMENT SYSTEMS BASIC CONCEPTS 1. What is a database? A database is a collection of data which can be used: alone, or alone, or combined /
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
Instructor: Churee Techawut Basic Concepts of Relational Database Chapter 5 CS (204)321 Database System I.
Page 1 Topic 4 Relational Databases CPS510 Database Systems Abdolreza Abhari School of Computer Science Ryerson University.
Ad Hoc Constraints Objectives of the Lecture : To consider Ad Hoc Constraints in principle; To consider Ad Hoc Constraints in SQL; To consider other aspects.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Functional Dependencies and Normalization for Relational Databases.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
Amendments & Transactions Objectives of the Lecture : To consider amendments to a relation; To consider transactions in SQL.
USE OF TEMPORAL CONCEPTS IN TRANSACTIONAL DATABASES.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
COMP1212 COMP1212 Anomalies and Dependencies Dr. Mabruk Ali.
Fall 2001Database Systems1 Triggers Assertions –Assertions describe rules that should hold for a given database. –An assertion is checked anytime a table.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Lection №4 Development of the Relational Databases.
SPATIO-TEMPORAL DATABASES Temporal Databases. Temporal Data. Modeling Temporal Data Temporal Semantics Temporal density: the time is seen as being: 
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Chapter 7 Functional Dependencies Copyright © 2004 Pearson Education, Inc.
COP-5725 Practice Exercises
Chapter 11: Sequential File Merging, Matching, and Updating Programming Logic and Design, Third Edition Comprehensive.
Temporal Data Modeling
Data The fact and figures that can be recorded in system and that have some special meaning assigned to it. Eg- Data of a customer like name, telephone.
Description and exemplification use of a Data Dictionary. A data dictionary is a catalogue of all data items in a system. The data dictionary stores details.
ACTIVE DATABASE Traditional database systems are passive: respond to applications We may wish to extend the database systems by allowing them to invoke.
Database Management COP4540, SCS, FIU Database Trigger.
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 4: Intermediate.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
SQL- Updates, Assertions and Views. Data Definition, Constraints, and Schema Changes Used to CREATE, DROP, and ALTER the descriptions of the tables (relations)
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Copyright © 2004 Pearson Education, Inc.. Chapter 24 Enhanced Data Models for Advanced Applications.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Logical Database Design and the Rational Model
Chapter 9 Database Systems
Chapter 7: Entity-Relationship Model
Temporal Databases.
ISC321 Database Systems I Chapter 4: SQL: Data definition, Constraints, and Basic Queries and Updates Fall 2015 Dr. Abdullah Almutairi.
Examines blended and separate transaction schemas
Author: Miran Miklič Comparison and advantages of the Bitemporal and Temporal databases over Tuple-versioning (point-in-time) database.
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs
Presentation transcript:

SPECIAL PURPOSE DATABASES 13/09/14371

Temporal Database Concepts  Time is considered ordered sequence of points in some granularity Use the term choronon instead of point to describe minimum granularity Use the term choronon instead of point to describe minimum granularity In reality, each second is a (short) time duration, not a point, In reality, each second is a (short) time duration, not a point, 13/09/14372

Temporal Database Concepts Time Representation, … (cont.)  A calendar organizes time into different time units for convenience. Accommodates various calendars Accommodates various calendars Gregorian (western)Gregorian (western) ChineseChinese IslamicIslamic HinduHindu JewishJewish Etc.Etc. 13/09/14373

Temporal Database Concepts Time Representation, … (cont.)  Point events Single time point event Single time point event E.g., bank depositE.g., bank deposit Series of point events can form a time series data Series of point events can form a time series data  Duration events Associated with specific time period Associated with specific time period Time period is represented by start time and end timeTime period is represented by start time and end time 13/09/14374

Valid Time and Transaction Time Dimensions  Given a particular event or fact that is associated with a particular time point or time period in the database.  The associated time is often referred to as the valid time.  A temporal database using this interpretation is called a valid time database.  when the associated time refers to the time when the information was actually stored in the Database transaction time  A temporal database using this interpretation is called a transaction time database.  the valid time and transaction time are referred as time dimensions 13/09/14375

Temporal Database Concepts Time Representation, … (cont.)  Transaction time The time when the information from a certain transaction becomes valid The time when the information from a certain transaction becomes valid  Bitemporal database Databases dealing with two time dimensions Databases dealing with two time dimensions 13/09/14376

Temporal Database Concepts Incorporating Time in Relational Databases Using Tuple Versioning  Add to every tuple Valid start time Valid start time Valid end time Valid end time 13/09/14377

Temporal Database Concepts 13/09/14378

Temporal Database Concepts 13/09/14379

 the current version of each employee typically  has a special value, now, as its valid end time. This special value, now, is a temporal variable that implicitly represents the current time as time progresses.  The nontemporal EMPLOYEE relation would only include those tuples from the EMP_VT relation whose Vet is now. 13/09/143710

Update operation on spatial databases  Whenever one or more attributes of an employee are updated, rather than actually overwriting the old values, as would happen in a nontemporal relation, the system should create a new version and close the current version by changing its Vet to the end time. Hence, when the user issued the command to update the salary of Smith effective on June 1, 2003, to $30000, the second version of Smith was created (see Figure 26.8).At the time of this update,  the first version of Smith was the current version, with now as its Vet, but after the update now was changed to May 31, 2003 (one less than June 1, 2003, in day granularity), to indicate that the version has become a closed or history version and that the new (second) version of Smith is now the current one. 13/09/143711

Updating types in temporal database  It is important to note that in a valid time relation, the user must generally provide the valid time of an update. For example, the salary update of Smith may have been entered in the database on May 15, 2003, at 8:52:12 A.M., say, even though the salary change in the real world is effective on June 1,  This is called a proactive update, since it is applied to the database before it becomes effective in the real world.  If the update is applied to the database after it becomes effective in the real world, it is called a retroactive update.  An update that is applied at the same time as it becomes effective is called a simultaneous update. 13/09/143712

Deleting in a temporal database  The action that corresponds to deleting an employee in a nontemporal database would typically be applied to a valid time database by closing the current version of the employee being deleted.  For example, if Smith leaves the company effective January 19, 2004, then this would be applied by changing Vet of the current version of Smith from now to  In Figure 26.8, there is no current version for Brown, because he presumably left the company on and was logically deleted. However, because the database is temporal, the old information on Brown is still there. 13/09/143713

Insert in a temporal database  The operation to insert a new employee would correspond to creating the first tuple version for that employee, and making it the current version, with the Vst being the effective (real world) time when the employee starts work. In Figure 26.7, the tuple on Narayan illustrates this, since the first version has not been updated yet. 13/09/143714

Primary key in temporal database  Notice that in a valid time relation, the nontemporal key, such as Ssn in EMPLOYEE, is no longer unique in each tuple (version). The new relation key for EMP_VT is a combination of the nontemporal key and the valid start time attribute Vst,16 so we use (Ssn, Vst) as primary key. This is because, at any point in time, there should be at most one valid version of each entity. Hence, the constraint that any two tuple versions representing the same entity should have nonintersecting valid time periods should hold on valid time relations.  Notice that if the nontemporal primary key value may change over time, it is important to have a unique surrogate key attribute, whose value never changes for each real-world entity, in order to relate all versions of the same real-world entity. 13/09/143715

Transaction Time Relations.  Valid time relations basically keep track of the history of changes as they become effective in the real world.  However, because updates, insertions, and deletions may be applied retroactively or proactively, there is no record of the actual database state at any point in time.  If the actual database states are important to an application, then one should use transaction time relations. 13/09/143716

 In EMP_TT, each tuple V represents a version of an employee’s information that was created at actual time V.Tst and was (logically) removed at actual time V.Tet (because the information was no longer correct). In EMP_TT, the current version of each employee typically has a special value, uc (Until Changed), as its transaction end time, which indicates that the tuple represents correct information until it is changed by some other transaction. A transaction time database has also been called a rollback database, because a user can logically roll back to the actual database state at any past point in time T by retrieving all tuple versions V whose transaction time period [V.Tst, V.Tet] includes time point T. Transaction Time Relations. 13/09/143717

Bitemporal Relations  Some applications require both valid time and transaction time, leading to bitemporal relations  In our example, Figure 26.7(c) shows how the EMPLOYEE and DEPARTMENT nontemporal relations in Figure 26.1 would appear as bitemporal relations EMP_BT and DEPT_BT, respectively. Figure 26.9 shows a few tuples in these relations. In these tables, tuples whose transaction end time Tet is uc are the ones representing currently valid information, whereas tuples whose Tet is an absolute timestamp are tuples that were valid until (just before) that timestamp. Hence, the tuples with uc in Figure 26.9 correspond to the valid time tuples in Figure The transaction start time attribute Tst in each tuple is the timestamp of the transaction that created that tuple. 13/09/143718

13/09/143719