DD 8 1
DD 8 1
DD 8 1
8-1
Modeling Historical Data
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 3
Modeling Historical Data
Purpose
• How tall were you at age 5? How tall were you at age 10?
How tall are you right now?
• If your parents wrote this down when you were young, they
were keeping track of historical data.
• Most businesses need to track some historical data.
• This helps them find trends and patterns that are the basis for
business innovations or process improvements.
• For example, rental history of a movie is useful to a video
store. It tells managers which movies are popular and which
should be moved to the back shelf.
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 4
Modeling Historical Data
Model Data Over Time
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 5
Modeling Historical Data
Data Over Time Example
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 6
Modeling Historical Data
Model Salary Changes
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 7
Modeling Historical Data
Model Rental Over Time
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 8
Modeling Historical Data
Resolve M:M
JEWELRY PIECE MOVIE STAR
rented by # id
# code
* description * first name
• The relationship between * rental rate renting * last name
JEWELRY PIECE and MOVIE * insured value
STAR should be revised to a The M:M relationship is resolved with an
M:M, which is then resolved intersection entity.
with an intersection entity
RENTAL HISTORY for MOVIE STAR
RENTAL HISTORY. * rental date # id
* first name
• Next we need to determine * date returned on
* last name
the UID of RENTAL HISTORY. for
on
JEWELRY PIECE
# code
* description
* rental rate
* insured value
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 9
Modeling Historical Data
Determine UID
• Option 1: Barred
relationship. RENTAL HISTORY for
* rental date
MOVIE STAR
# id
• Drawing a Barred on
* date returned * first name
* last name
relationship is not a for
suitable UID here, as
this would not allow a on
MOVIE STAR to rent JEWELRY PIECE
the same JEWELRY # code
* description
PIECE on different * rental rate
dates * insured value
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 10
Modeling Historical Data
Determine UID
• Option 2: Barred
relationship and Rental RENTAL HISTORY for
# rental date
MOVIE STAR
# id
Date. * date returned on * first name
* last name
• Adding rental date to the for
UID would allow a MOVIE
STAR to rent the same on
JEWELRY PIECE on JEWELRY PIECE
different dates, but # code
* description
would also permit * rental rate
different MOVIE STARS * insured value
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 11
Modeling Historical Data
Determine UID
• Option 3: Barred
relationship between RENTAL HISTORY for
# rental date
MOVIE STAR
# id
MOVIE STAR and * date returned on * first name
RENTAL HISTORY with * last name
given day.
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 12
Modeling Historical Data
Determine UID
• Option 4: Barred
relationship between RENTAL HISTORY for
# rental date
MOVIE STAR
# id
JEWELRY PIECE and * date returned on * first name
RENTAL HISTORY with * last name
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 13
Modeling Historical Data
Terminology
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 14
Modeling Historical Data
Summary
DDS8L1 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 15
Modeling Historical Data