Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
FCT_EMPLOYEE
DIM_CITY
ID
NAME
ID(pk)
STATEID
DIM_STATE
ID(pk)
NAME
DIM_ EMPLOYEE
1001 AA A
1002 BB B
1003 CC C
1004 DD D
1005 EE E
SQL Query
select avg(sal),grade
group by grade;
2. Find out City wise maximum, minimum, average salary of employee for the period id 20150131.
select name,max(sal),min(sal),avg(sal)
where fe.city_id=dc.id
and period_id=20150131
group by name;
minus
connect by level<=b-a+1
);
where period_id=&n
group by period_id;
5. Month by Month, grade wise top 2 average increase in salary for the period id 20150131 and 20150228.
SELECT * FROM
WHERE R<=2
select ds.name,grade,max(sal)
where de.id=fe.id
and ds.id=dc.state_id
and dc.id=fe.city_id
group by ds.name,grade;
select grade,max(salary)
where f.id=d.id
group by grade
end);
Data Model
8. Change the structure of model to add pin code and address to the employee table. It should accept whatever
the address may be even multiple addresses.
9. Change structure of the model to add department number in the employee table. There should be a facility to
add more than one department number to an employee table. The percentage of cardinality of working should
not exceed 100%.