You are on page 1of 1

Join Indexes:

These are also a kind of view. There are three types of join indexes they are
i)Single table join index: Simple join
EX:
create join index demoindex1
as
SELECT EMP_ID,EMP_NAME,salary
FROM employees
PRIMARY INDEX(EMP_ID)
;

ii) Multi table join index: Multi table Join


EX:
create join index demoindex2
as
SELECT a.EMP_ID,b.EMP_NAME
FROM Employees a
join
course b on a.emp_id=b.emp_id
PRIMARY INDEX(emp_id);

iii) Aggregate table join index: When we use aggregate operations


EX:
create join index demoindex3
as
SELECT emp_id,emp_name,sum(salary)
FROM employees
GROUP BY 1,2
PRIMARY INDEX(emp_id);

You might also like