Friday, September 23, 2016

Modeling Change: Time

  • ·         A constraint or data restriction that results from the time dimension. - Time-related Constraint
  • ·         Refers to a relationship that may or may not be transferable, depending on time.- Conditional Non-transferability
  • ·         Property of a relationship where an instance of A is related to an instance of B, and the association cannot be moved to another instance of B non- transferability
1.  Speeding Tickets
Each police officer may issue speeding tickets to motorists in an assigned area. Originally, the attribute date was modeled as part of the SPEEDING TICKET entity. However, the city police department wants to see if there is a relationship between weather and the frequency of speeding tickets -- do people drive faster on nice sunny days? Are there more tickets in hot weather or cool weather?

Modify the ERD to address this new requirement.

2. Examine the ERD that represents classroom assignments for different exams.

a. Why is start time part of the UID of ASSIGNMENT?
Each assignment identified by StartTime, amongst instances with same exam, date of exam, and class.

Say, no of students in class are more than no of computers available on which exam will be presented. So I have timeslots mentioned in assignment instances.

b. Name at least three time-related constraints. For example: End time must be later than start time. Indicate if the constraint represents conditional non-transferability.
  • ·         An exam cannot be unassigned b/w starttime and end time. This one is a conditional non-transferability.

StartTime field is not dateTime, its only time here e.g. 20:30, not 21September 2016 20:30. Same is true for rnd time.  [Why didn’t we store it as a datetime rather than date and time separately in two attributes?]
  • ·         Start time and end time are times occurring in date of exam.
  • ·         Also, Below mentioned ERD restrict exam to finish on the same day. Since if end time is on the next day, it is not recorded anywhere. [ better is store end datetime if I want to allow exam to continue to next day.]
  • ·         There must be at least one day and start time in that same day when an exam instance must be assigned to any class.

No comments:

Post a Comment