You are on page 1of 6

select customer_name from depositor where accno in (select accno from account wh ere branch_name in (select branch_name from

branch where branch_city='bang')grou p by customer_name having count(*)) =(select count(*) from branch where branch_c ity='bang') / SQL> select book_isbn from text where publiser='tmh'; select book_isbn from text where publiser='tmh' * ERROR at line 1: ORA-00904: invalid column name SQL> ed Wrote file afiedt.buf 1* SQL> 1* SQL> select book_isbn from text where publisher='tmh' ; select book_isbn from text where publisher='tmh' /

BOOK_ISBN ---------111 444 SQL> ; 1* select book_isbn from text where publisher='tmh' SQL> select * from branch; BRANCH_NAME -------------------main vijaynagar gandhinagar rrnagar BRANCH_CITY ASSETS -------------------- ---------bang 12000 bang 22000 bang 33000 hubli 11000

SQL> select * from account; ACCNO ---------11 12 13 14 BRANCH_NAME BALANCE -------------------- ---------main 11000 gandhinagar 11000 vijaynagar 12000 rrnagar 22000

SQL> select * from depositer; select * from depositer * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from depositor; CUSTOMER_NAME ACCNO -------------------- ---------reshma 11 reshma 12

reshma amit ravi SQL> select * from customer; CUSTOMER_NAME -------------------ramesh reshma ravi amit

13 14 12

CUSTOMER_STREET -------------------patna patna patna patna

CUSTOMER_CITY -------------------bihar bihar bihar bihar

SQL> select * from loan; LOAN_NO ---------111 222 333 BRANCH_NAME AMOUNT -------------------- ---------main 11000 vijaynagar 11000 gandhinagar 22000

SQL> select * from borrower; CUSTOMER_NAME LOAN_NO -------------------- ---------reshma 111 ravi 222 amit 333 SQL> select * from account; ACCNO ---------11 12 13 14 15 BRANCH_NAME BALANCE -------------------- ---------main 11000 gandhinagar 11000 vijaynagar 12000 rrnagar 22000 main 12000

SQL> select * from depositor; CUSTOMER_NAME ACCNO -------------------- ---------reshma 11 reshma 12 reshma 13 amit 14 ravi 12 reshma 15 6 rows selected. SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' ))group by customer_name having count(*) > 1 SQL> ; 1* select customer_name from depositor where accno in (select accno from accou

nt where branch_name in (select branch_name from branch where branch_city='bang' ))group by customer_name having count(*) > 1 SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' ))group by customer_name having count(*) > 1 SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' )); SQL> / select customer_name from depositor where accno in (select accno from account wh ere branch_name in (select branch_name from branch where branch_city='bang')); * ERROR at line 1: ORA-00911: invalid character SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in nt where branch_name in (select branch_name from branch )) SQL> ; 1* select customer_name from depositor where accno in nt where branch_name in (select branch_name from branch )) SQL> / CUSTOMER_NAME -------------------reshma reshma reshma ravi reshma SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' )) group by customer_name 2 / CUSTOMER_NAME -------------------ravi reshma SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou (select accno from accou where branch_city='bang' (select accno from accou where branch_city='bang'

nt where branch_name in (select branch_name from branch where branch_city='bang' )) group by customer_name having count(*) > 2 SQL> / CUSTOMER_NAME -------------------reshma SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' )) group by customer_name having count(*) =3 SQL> / no rows selected SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' )) SQL> / CUSTOMER_NAME -------------------reshma reshma reshma ravi reshma SQL> ed Wrote file afiedt.buf 1* select count(*)customer_name from depositor where accno in (select accno fr om account where branch_name in (select branch_name from branch where branch_cit y='bang')) group by customer_name SQL> / CUSTOMER_NAME ------------1 4 SQL> select branch_name from branch where branch_city='bang'; BRANCH_NAME -------------------main vijaynagar gandhinagar SQL> select accno from account where accno in (select branch_name from branch wh ere branch_city='bang'); select accno from account where accno in (select branch_name from branch where b ranch_city='bang') *

ERROR at line 1: ORA-01722: invalid number SQL> ed Wrote file afiedt.buf 1* select accno from account where branch_name in (select branch_name from bra nch where branch_city='bang') SQL> / ACCNO ---------11 12 13 15 SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' )group by customer_name having count(*)) =(select count(*) from branch where bra nch_city='bang') SQL> / select customer_name from depositor where accno in (select accno from account wh ere branch_name in (select branch_name from branch where branch_city='bang')grou p by customer_name having count(*)) =(select count(*) from branch where branch_c ity='bang') * ERROR at line 1: ORA-00920: invalid relational operator SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou nt where branch_name in (select branch_name from branch where branch_city='bang' )group by customer_name having count(*)) =(select count(*) from branch where bra nch_city='bang') SQL> / select customer_name from depositor where accno in (select accno from account wh ere branch_name in (select branch_name from branch where branch_city='bang')grou p by customer_name having count(*)) =(select count(*) from branch where branch_c ity='bang') * ERROR at line 1: ORA-00920: invalid relational operator SQL> ed Wrote file afiedt.buf 1* select customer_name from depositor where accno in (select accno from accou

nt where branch_name in (select branch_name from branch where branch_city='bang' )group by customer_name having count(*)) =(select count(*) from branch where bra nch_city='bang') SQL>

You might also like