1.

Write An Assertion For The Bank Database To Ensure That The Assets Value For The Perry Ridge Branch Is Equal To The Sum Of All The Amounts Lent By The Perry Ridge Branch?

Answer»

The ASSERTION-name is ARBITRARY. We have CHOSEN the name Perry. Note that since the assertion applies only to the Perry ridge branch we must RESTRICT attention to only the Perry ridge tuple of the branch relation rather than writing a constraint on the entire relation.

create assertion perry check (not exists (select * from branch where branch-name = ’Perryridge’ and assets ?= (select sum (amount) from loan where branch-name = ’Perryridge’)))

The assertion-name is arbitrary. We have chosen the name Perry. Note that since the assertion applies only to the Perry ridge branch we must restrict attention to only the Perry ridge tuple of the branch relation rather than writing a constraint on the entire relation.



Discussion

No Comment Found

Related InterviewSolutions