This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ( select br_name from branch where br_city=’BTR’ except/minus ( select branch.br_name from account,depositor where account.acct_num = depositor.acct_num AND depositor.cus_name = customer.cus_name ) ) With “positive logic” – where the number of accounts in branches in BTR = number of branchesin BTR Select cus_name from customer where ( select count(*) from branch where br_city=’BTR’ ) = ( select count(distinct br_name) from depositor, account where depositor.acct_num = acct.acct_num AND customer.cus_name = depositor.cus_name AND br_name in ( select br_name from branch where br_city=’BTR’) ) Derived relation example – simpler, cleaner query Select br_name, avg(balance) as avg_b from account group by br_name having avg(balance) > 1200...
View Full Document
This note was uploaded on 01/25/2010 for the course CSC 4402 taught by Professor Staff during the Fall '08 term at LSU.
- Fall '08