Chapter 6: Integrity Constraints: Domain Constraints Referential Integrity Assertions Triggers Functional Dependencies
Chapter 6: Integrity Constraints: Domain Constraints Referential Integrity Assertions Triggers Functional Dependencies
Chapter 6: Integrity Constraints: Domain Constraints Referential Integrity Assertions Triggers Functional Dependencies
Domain Constraints
Referential Integrity
Assertions
Triggers
Functional Dependencies
&
6.1
c
Silberschatz, Korth and Sudarshan
1997
'
Domain Constraints
&
6.2
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.3
c
Silberschatz, Korth and Sudarshan
1997
'
Referential Integrity
&
6.4
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.5
c
Silberschatz, Korth and Sudarshan
1997
'
Database Modification
t2 [] K (r1 )
Delete. If a tuple t1 is deleted from r1 , the system must
compute the set of tuples in r2 that reference t1 :
&
= t1 [K ] (r2 )
6.6
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.7
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.8
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.9
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.10
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.11
c
Silberschatz, Korth and Sudarshan
1997
'
&
6.12
c
Silberschatz, Korth and Sudarshan
1997
'
Assertions
&
6.13
c
Silberschatz, Korth and Sudarshan
1997
'
Assertion Example
The sum of all loan amounts for each branch must be less than
the sum of all account balances at the branch.
create assertion sum-constraint check
(not exists (select * from branch
where (select sum(amount ) from loan
where loan.branch-name = branch.branch-name)
>= (select sum(amount ) from account
where loan.branch-name = branch.branch-name)))
&
6.14
c
Silberschatz, Korth and Sudarshan
1997
'
Assertion Example
&
6.15
c
Silberschatz, Korth and Sudarshan
1997
'
Triggers
&
6.16
c
Silberschatz, Korth and Sudarshan
1997
'
Trigger Example
&
6.17
c
Silberschatz, Korth and Sudarshan
1997
'
&
The keyword new used before T.balance indicates that the value of
T.balance after the update should be used; if it is omitted, the value
before the update is used.
6.18
c
Silberschatz, Korth and Sudarshan
1997