Você está na página 1de 6

COURSE TITLE:

ADVANCE DATABASE MANAGEMENT SYSTEM


(TEMPORAL DATABASES)

COURSE CODE: MSCS - 703

ASSIGNMENT # 2 (CHAPTER 4)
SOLUTION TO THE EXERCISE)

COURSE SUPERVISOR:
MERITORIOUS PROF DR S M AQIL BURNEY

CO –SUPERVISOR:
MR. NADEEM MAHMOOD

SUBMITTED BY:
SAMEEN ATHAR
QUESTION 1: STATE AS PRECISELY AS YOU CAN THE PREDICATES FOR THE
FOLLOWING:

Part a: Relvars S and SP as illustrated in Endpaper Panel 1

S: Supplier S# is currently under contract.


SP: Supplier S# supply the relevant Product P#.

In the case of Query B, the first projection is actually an identity projection (the expression
"S{S#}" is logically equivalent to just "S"). Which may be shown as an explicit projection for
reasons of clarity?

Part b. Relvars S_SINCE and SP_SINCE as illustrated in Endpaper Panel 2

S_SINCE: Ever since day SINCE (and not on the day immediately before day SINCE), supplier
S# has been under contract.

SP_SINCE: Ever since day SINCE (and not on the day immediately before day SINCE), supplier
S# has been able to supply part P#.
Part c. Relvars S_FROM_TO and SP_FROM_TO as illustrated in Endpaper Panel 3

S_FROM_TO: From day FROM (and not on the day immediately before FROM) to day TO (and
not on the day immediately after TO), inclusive, supplier S# was under contract.

SP_FROM_TO: From day FROM (and not on the day immediately before FROM) to day TO (and
not on the day immediately after TO), inclusive, supplier S# was able to supply part P#.
QUESTION 2: EXPLAIN THE REDUNDANCY AND CIRCUMLOCUTION PROBLEMS
IN YOUR OWN WORDS.

Redundancy is the appearance of duplicate tuples in the temporal database. (same attributes with
overlapping time)

Example: Redundancy will occur if the relvar contains, for example, both of the following
tuples at the same time:

CIRCUMLOCUTION:

Same attributes with different, non-overlaping but connecting time.

Example: Circumlocution will occur if the relvar contains, for example, both of the following
tuples at the same time:
QUESTION 3: WRITE TUTORIAL D EXPRESSIONS FOR THE FOLLOWING QUERIES
ON THE DATABASE ILLUSTRATED IN ENDPAPER PANEL 2:

a. Get supplier numbers for suppliers who are currently able to supply at least two different
parts, showing in each case the date since when they have been able to do so.

Answer:

SUMMARIZE SP PER SP { S# } ADD MIN ( SINCE ) AS SINCE

CONSTRAINT S_ FROM_TO_OK IS EMPTY ( S_FROM_TO WHERE TO >0 ) AND

CONSTRAINT S_ FROM_TO_OK IS EMPTY ( S_FROM_TO WHERE TO < 3 );

b. Get supplier numbers for suppliers who are currently unable to supply at least two
different parts, showing in each case the date since when they have been unable to do so.

Answer:

SUMMARIZE S PER S{ S# } MINUS SP { S# } AS SINCE

CONSTRAINT S_ FROM_TO_OK IS EMPTY ( S_FROM_TO WHERE TO >0 ) AND

CONSTRAINT S_ FROM_TO_OK IS EMPTY ( S_FROM_TO WHERE TO < 3 );

c. What about analogs of these two queries on the database illustrated in Endpaper Panel 3?
At least try to state such analogs in natural language, even if you decide you would rather not
attempt to come up with any corresponding Tutorial D formulations.

Answer:

{The analogs about the difference in query a and query b is simply the inclusion and
omission of some attribute w.r.to semi-temporalization.}

Você também pode gostar