Sunteți pe pagina 1din 6

8-1 Modeling Historical Data

- Need to track Historical Data (data that records changes over time)
- Construct ERD models that incorporate elements of “data over time”

1. Model Data Over time + 2. Model Data Over time Example +3. Model Salary
Changes + 4. Model Rental Over time

- Audit trail = A step-by-step record of data changes


- The UID of the SALARY HISTORY entity is the related EMPLOYEE id + the
salary start date

- To track the rental history, we need a M:M relationship between JEWELRY


PIECE and MOVIE STAR

5. Resolve M:M


6. Determine UID
a. Option1 : Barred relationship – not good , because this UID would not allow the
same combination of MOVIE START id and JEWELRY(bijuterii) PIECE code to
be entered more than once on different date
b. Option2: Barred relationship and Rental date – not good would permit different
MOVIE STARS to rent the same JEWELRY PIECE on the same date

c. Option3 : Barred relationship between MOVIE START and RENTAL HISTORY +


rental date – not good: would not permit the same MOVE START to rent more
than one JEWELRY PIECE on a given day

d. Option 4 : Barred relationship between JEWELRY PIECE and RENTAL


HISTORY + rental date – good – the model says that JEWELRY PIECE can be
rented only once on the same date

8-2 Modeling Change: Time


Distinguish between using date as an attribute and DAY as an entity in a data model
1. Entity DAY vs. Attribute Date

 
 

2. Time related constraints


- Time-related constraints: A constraint or data restriction that results from the time
dimension.

3. Conditional Non- transferability


- Conditional nontransferability: Refers to a relationship that may or may not be
transferable, depending on time. In this case, if the relationship can be
transferable, this relationship cannot be represented in the diagram, but must still
be documented
- Nontransferable relationships are represented by a diamond in the ERD

8-3 Modeling Change: Price


- Appreciation: A rise in value or price, especially over time.
- Depreciation: A decrease or loss in value because of age, wear, or market
conditions.
- This model shown here tracks the historical price of a product
-

- /

- Journaling: Keeping an on-going record of transactions.

- The PAYMENT entity could have additional attributes and relationships to


PAYOR and PAYEE, but we have left them out of the diagram to keep things
simple.
Apart from the consequences for the conceptual data model, the system needs special
journaling functionality: any business function that allows an update of PAYMENT
amount should result in the requested update, plus the creation of a new instance of
AMOUNT MODIFICATION with the proper values. This functionality has to be
implemented by programming.
8-4 Drawing Conventions for Readability
- Identify high volume entities in a data model diagram and explain their
significance to the business.
- Redraw a given data model diagram to increase clarity and readability
- Recognize the usefulness of dividing a complex ERD into a number of functional
sub diagrams

1. Large ERD Drawing conventions


- Two drawing conventions that are widely (pe scara larga) in use:
o Place high volume entities towards(catre) the top left of the page
o Places high volume entities towards the bottom right of the page
- It is not important which convention you fallow, but chose one
- A high volume entity is an entity that will have a large number of instances
- high volume entities are often the ‘central’ or more important entities in a ERD
o will have the highest number of relationships to other entities

2. Clarity is Key
- Never let a convention interfere with readability and clarity
- readability and clarity are the main criteria
- for readability and clarity:
o avoid crossing relationship lines
o avoid entities that overlap (suprapun)
o avoid relationship lines that cross entities
o split larger ERDs into smaller sub-diagrams if required
o Space is needed – use white space
- Smaller sub-diagrams can be useful during physical modeling and application
development as well as during conceptual-modeling discussions with the client.

S-ar putea să vă placă și