create view 'loan_deduction' asselect l.loan-number, case when amount <700 then amount * 0.995 else amount * 0.997 end as pred_amountfrom l.loan;
create view v-numacct-bycategory asselect b.branch-name, b.branch-city, sum (case when a.balance < 1000 then 1 else 0 end) as nums1, sum ( case when a.balance >= 1000 and a.balance<=10000 then 1 else 0 end) as nums2, sum( case when a.balance > 10000 then 1 else 0 end) as nums3from branch b JOIN account a ON b.branch_name = a.branch_namegroup by b.branch-name, b.brainch-city;
insert into branch (branch_name, branch_city, assets)select distinct branch_name, 'vice city', 100000from accountwhere branch_name not in (select branch_name from branch);
update branchset assets = assets + 300where branch_name in (select branch_name from account)and branch_name not in (select branch_name from loan);
delete from borrowerwhere customer_name in ( select customer_name from customer where customer_city = 'salt lake')and customer_name not in (select customer_name from depositor);