











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!












select A 1, A 2,…,A n from r1,r 2 ,…,rn where P
A represents attribute r represents relation P represents predicate
“Find all loan number for loans made at the San Jose branch with loan amounts greater than $1200.”
select loan-number from loan Where branch-name = ‘San Jose’ and amount >
select distinct branch-name from loan
select all branch-name from loan
To list in alphabetic order all customers who have a loan at the San Jose branch.
select distinct customer-name from borrow, loan where borrow.loan-number = loan.loan- numebr and branch-name =‘San Jose’ order by customer-name
To find all customer having a loan, an account, or both at the bank.
( select customer-name from depositor union ( select customer-name from borrower)
To find all customers who have an account but no loan at the bank.
( select distinct customer-name from depositor) except ( select customer-name from borrower)
Five built-in aggregate function:
A delete request is expressed in much the same way as q query. We can delete only whole tuples.
delete from r where P
Delete all account tuples in the San Jose branch
delete from account where branch-name = ‘San Jose’
We may wish to change a value in a tuple without changing all value in the tuple, then we can use update statement.
Suppose that annual interest payment are being made, and all balance are to be increased by 5 percent. update account set balance = balance * 1.