데이터베이스
- 최초 등록일
- 2021.04.30
- 최종 저작일
- 2021.03
- 6페이지/ MS 워드
- 가격 1,000원
목차
없음
본문내용
(a) CREATE VIEW highorders
AS select od.bookid, bk.bookname, cs.name, bk.publisher, od.saleprice
from customer cs, orders od, book bk
where cs.customer=od.custid and od.bookid=bk.bookid and saleprice >= 20000;
(b) create or replace view highorders
As select od.bookid, bk.bookname, cs.name, bk.publisher
From customer cs, orders od, book bk
Where cs.custid=od.custid and od.bookid=bk.bookid and saleprice >=20000;
(C) create view regularCustomer
as select a.name,b.saleprice, b.orderdate, c.bookname
from (select *, count(*) as 주문횟수 from orders group by custid having 주문횟수 >='2') as b , customer a, book c
where a.custid = b.custid;
(d) select b.name, a.구매금액, (구매금액*0.1) as 인센티브 from (select * , sum(saleprice) as 구매금액 from orders group by custid) as a, customer b
where a.custid = b.custid;
참고 자료
없음