Joe Celko's Data and Databases: Concepts in Practice
By Joe Celko
Chapter 9: Temporal Data
Chapter 9: Temporal Data
Overview
Temporal data is the hardest type of data for people to handle conceptually. Perhaps time is difficult because it is dynamic and all other datatypes are static, or perhaps because time allows multiple parallel events. To illustrate both points, let me tell two old jokes:
A youngster gets his first nondigital watch. His father asks him, ?What time is it?? The child replies, ?I don?t know. The hands never stop moving!?
?Time is what keeps everything from happening at once.??tee shirt slogan.
Okay, the jokes were not very good, but let me convince you that you do not understand how to compute with time. This is an old puzzle that still catches people. If a hen and a half can lay an egg and a half in a day and a half, then how many hens does it take to lay six eggs in six days? Do not look at the rest of the page and try to answer the question in your head.
The answer is a hen and a half. People tend to get tripped up on the rate (eggs per hen per day) because they handle time wrong. For example, if a cookbook has a recipe that serves one and you want to serve 100 guests, you increase the amount of ingredients by 100, but you do not cook it 100 times longer.
The algebra in this problem looks like this, where we want to solve for the rate in terms...
Copyright Morgan Kauffmann Publishers 1999 under license agreement with Books24x7