create table customer(cname char(20) not null,
street char(30),
city char(30),
primary key (cname))
create table branch(bname char(15) not null,
bcity char(30),
assets integer,
primary key (bname)
check (assets >= 0))
create table account(account# char(10) not null,
(bname char(15),
balance integer,
primary key (account#)
foreign key (bname) references branch,
check (balance >= 0))
create table depositor(cname char(20) not null,
account# char(10) not null,
primary key (cname, account#)
foreign key (cname) references customer,
foreign key (account#) references account)
bname char(15) references branch
create table account...
foreign key (bname) references branch
on delete cascade
on insert cascade,
...
If a delete of a tuple in branch results in the preceding referential integrity constraints being violated, the delete is not rejected, but the delete ``cascade'' to the account relation, deleting the tuple that refers to the branch that was deleted. Update will be cascaded to the new value of the branch!
If a cascading update or delete causes a constraint violation that cannot be handled by a further cascading operation, the system aborts the transaction and all the changes caused by the transaction and its cascading actions are undone.