22.05.24~22.11.16/7月

07-26 <Oracle> : view 와 index 생성, 삭제

10월의끝 2022. 7. 26. 14:45

view 생성

create view v_emp_salary
as
select department_id, sum(salary) as "sal_num", avg(salary) as "sal_avg"
from employees
group by department_id

view 삭제

drop view v_emp_salary

=> view는 insert 불가능함

 

 

 

index 생성

create index idx_employees_fname
on employees(first_name)

index 삭제

drop index idx_employees_fname

=> 검색 속도를 빠르게 함