























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























ensure that changes made to the database by authorized users do not result in loss of data consistency.
Creating New Domains
Referential Integrity
Referential Integrity in SQL: Foreign Keys
Foreign Key Declaration
create table account
( account-number char(10), branch –name char(15), balance integer, primary key (account-number), foreign key (branch-name) references branch, check ( balance >= 0))
Delete Cascade
anything that has references to the deleted item is also deleted.
Update Cascade
when the updated item results in a violation of referential integrity, the system will update accordingly to fix the problem.
Assertions
Creating an Assertion
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 (balance) from account where account.branch-name = branch.branch-name )))
Triggers
Triggers
database is important.
way to protect it against unauthorized access, malicious destruction or alteration, and accidental introduction of data inconsistency.
Database Security