티스토리 뷰

select sum(saleprice) AS '매출액', 

avg(saleprice), AS'평균', 

max(saleprice)AS '최대판매금액' ,

min(saleprice) AS '최소 판매금액',

count(saleprice) AS'총주문건수'


from orders


--select bookid, bookname, publisher

select count(distinct publisher)

from book--






select bookname

from book

where price = 

(select max(price)AS '가장비싼도서'

from book

WHERE publisher = '대한미디어'

and !publisher = '대한미디어')