Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

1.

Create view SumSalesman as


Select count(name) as countName, city from Salesman group by city

Select * from SumSalesman

2.create view OrdersOfSalesmans as


SELECT SalesmanName, Sum(purch_amt) AS '���. ������',
Avg(purch_amt) as '��. ������' from orders as O Left JOIN salesman as S on
S.salesman_id = O.salesman_id

Select * from orderOfSalesmans

3. Create view CustomersSum as


Select Count(cust_id) as countCust_id , SalesmanName from Customer
as C Left Join Salesman as S on c.salesman_id = s.salesman_id

Select * from CustomerSum

4. Create view OrdersAday as


Select count(ord_no) as countOrd_no, ord_date from orders Group by ord_no

Select * from OrdersAday

5. Create view ord_dateofSalesman


as Select salesman_id from orders where ord_date IN ('2012-08-17', '2012-10-10')

Select * from ord_dateofSalesman

7. Drop view SumSalesman


Drop view OrdersOfSalesmans
Drop view CustomersSum
Drop view OrdersAday
Drop view ord_dateofSalesman

You might also like