Sie sind auf Seite 1von 2

select * from salespeople11 where scity like '%San%';

select * from customer11;

select * from orders11;

select sname ,comm from salespeople11 where scity='london';

select onum,amt,odate from orders11 join salespeople11 on


salespeople11.snum=orders11.snum where sname like'%Motika%';

select * from salespeople11;

select cname from customer11 join orders11 on customer11.cnum=orders11.cnum where


odate like '%10/3/1996%';

select sum(amt),odate from orders11


where amt>2000
group by odate;

select * from orders11 where amt>;

select snum,sname from salespeople11 where exists (select cnum from customer11
where customer11.snum=salespeople11.snum and rating>6);

select distinct a.cname,b.rating from customer11 a join customer11 b on a.rating =


b.rating where a.rating in (7,9);

select * from (select cname from customer11 as a join customer11 as b on


a.rating=b.rating group by rating) ;

select a.cname,b.rating from customer11 a,customer11 b where a.rating = b.rating


and a.cname != b.cname;

select snum from salespeople11 where sname like '%Serres%';

select * from(select cnum,cname,s.snum as snum,sname from customer11 c join


salespeople11 s on c.snum=s.snum where cnum>1000) where sname like '%Serres%';

select snum,sname,scity,round((comm/0.87*100),2) as commi_in_per from


salespeople11;

select cname ,ccity from customer11 c join orders11 o on o.cnum=c.cnum where


odate='3-oct-1996';

select o.odate,max(o.amt) as amt from salespeople11 s join orders11 o on


o.snum=s.snum where amt>3000 group by odate;

select s.sname,max(amt) amt from salespeople11 s join orders11 o on s.snum=o.snum


where odate='3-oct-1996' group by sname;

select cname,ccity from salespeople11,customer11 where


salespeople11.snum=customer11.snum and sname like'%Serres%';
select * from customer11 where rating>6;

select distinct count(s.snum) as cnt_of_salespeople from orders11 o join


salespeople11 s on o.snum=s.snum ;

select cname,sname,comm from customer11 c join salespeople11 s on s.snum=c.snum


where comm>0.11 ;

select count(s.snum) cnt1 from customer11 c join salespeople11 s on c.snum=s.snum


where cnt1>1 group by s.snum;

select sname ,cname from salespeople11 s join customer11 c on s.snum=c.snum where


s.scity=c.ccity;

select * from salespeople11 where sname like'P%';

select * from (select onum,amt,odate from customer11 c join orders11 o on


c.cnum=o.cnum where cname like'%Cisneros%');

select sname,max(amt) from orders11 o join salespeople11 s on o.snum=s.snum where


sname in('Serres','Rifkin') group by sname;

select snum,sname,comm,scity from salespeople11;

select * from customer11 where cname like'[A-G]


%';**********************************************

select * from orders11 where amt>(select avg(amt) from orders11 where odate='4-oct-
1996');

select * from( select a.cname,b.cnum from customer11 a,customer11 b where


max(a.rating) and ccity=!b.ccity;*******************************************

select odate,sum(amt) as amt from orders11 group by odate order by amt desc;

select rating,cname from customer11 where ccity like'%San Jose%';

select onum ,amt,odate from orders11 o join customer11 c on o.cnum=c.cnum where


amt<*********************************

select cname,odate,amt from orders11 o join customer11 c on c.cnum=o.cnum where


amt>(select avg(amt) from orders11 );

select max(rating), ccity from customer11 group by ccity;

select count(cname) from customer11 where rating>(select avg(rating) from


customer11 where ccity like'%San Jose%');

select a.*,b.* from salespeople11 a,salespeople11 b order by a.snum desc;

select sname from salespeople11 where scity in('London','Barcelona');

select count(cname) cnt, sname from salespeople s join customer11 c on


s.snum=c.snum where cnt>1 group by cnt;

Das könnte Ihnen auch gefallen