You are on page 1of 9

The record that is highlighted is the record that is being deleted in the example.

E.61a (DELETE RESTRICT)


The record N cannot be deleted because in the record table SALES_REP there are three
instances where N is displayed. Thus, you cannot delete ‘N” in the territory table without
deleting the records that display ‘N’ in the SALES_REP table.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South Cannot be deleted
N North
C Central

E.61b (DELETE RESTRICT)


It will display as the second record W can be deleted because there is no instance in the record
table SALES_REP where W is displayed thus it can be deleted from the record table
TERRITORY.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central

RESULTS:
TerID TerName
E East
S South
N North
C Central

E.61c (DELETE RESTRICT)


The deletion would occur in the SALES_REP table because there is no other relation referencing
but there would be no change in the Territory table.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central

RESULT:
SRID SRName TerID
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E
E.61d(DELETE CASCADE)
The record will display that every instance with the territory N will also be deleted i.e. (5, Joe, N
6, Pat, N, and 7, Lee, N). this is because the TerID in the SALES_REP table is the foreign key
referring to the primary key TERID in the territory relation.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E
RESULT:
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
8 Joe E
TerID TerName
E East
W West
S South
C Central
E.61e (DELETE CASCADE)
The record would not cascade because there is no relation with the TERID ‘W’.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North Would not cascade.
C Central

E.61f (DELETE CASCADE)


The record would be freely deleted because there is no other relation referencing to the table
SALES_REP thusly the deletion would occur freely.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E
RESULT:
SRID SRName TerID
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central

E.61g (DELETE-SET-TO-NULL)
The record would delete the TerID values of N that are displayed in the SALE_REP relation.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central
RESULT:
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe
6 Pat
7 Lee
8 Joe E

TerID TerName
E East
W West
S South
C Central

E.61h (DELETE-SET-TO-NULL)
No change would occur in the SALES_REP relation because there are no values in the relation
SALES_REP that display the TerID ‘W’.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central
RESULT:
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
S South
N North
C Central

E.61i (DELETE-SET-TO-NULL)
The record would not be deleted because there is no record (1, Joe, N) that is available to be
deleted so there would be no change in either relation table.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central

E.61j (DELETE-SET-TO-DEFAULT)
The record would only display the records of ‘E, W, S,C’ because the default record would cause
that change to happen.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central
RESULT:
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe E
6 Pat E
7 Lee E
8 Joe E

TerID TerName
E East
W West
S South
C Central
E.61k (DELETE-SET-TO-DEFAULT)
The user would see no change in the SALES_REP relation table because there is no ‘W’
displayed.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central

RESULT:
TerID TerName
E East
S South
N North
C Central

E.61l (DELETE-SET-TO-NULL)
The default value would change only in the relation table SALES_REP because there is no other
relation referencing its primary key as a foreign key.
SRID SRName TerID
1 Joe E
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

TerID TerName
E East
W West
S South
N North
C Central
RESULT:
SRID SRName TerID
2 Sue E
3 Meg C
4 Bob S
5 Joe N
6 Pat N
7 Lee N
8 Joe E

Q.7.11
Structured Repository – a database containing analytically useful information. Any database is
a structured repository with a structure represented in its metadata.
Integrated – refers to the process of bringing the data from multiple operational databases into a
single data warehouse.
Subject-Oriented – refers to the fundamental difference in the purpose of an operational
database system and a data warehouse.
Enterprise-wide – refers to the fact that the data warehouse provides an organization-wide view
of the analytically useful information it contains.
Historical – refers to the larger time horizon in the data warehouse than in the operational
databases.
Time-variant – refers to the fact that a data warehouse contains slices or snapshots of data from
different periods of time within the time horizon.
Developed for the retrieval of analytical information – Data warehouse
May include the data at the fine level of detail or summary data or both - Datawarehouse

You might also like