Assignment for User Defined Function
See the below tables and solve the given queries.
Table: Employee
Employee_id |
First_Name |
Last_Name |
Salary |
Joining_date |
Department |
1 |
John |
Abraham |
1000000 |
01JAN13 12.00.00 AM |
Banking |
2 |
Michael |
Clarke |
800000 |
01JAN13 12.00.00 AM |
Insurance |
3 |
Roy |
Thomas |
700000 |
01FEB1312.00.00 AM |
Banking |
4 |
Tom |
Jose |
600000 |
01FEB1312.00.00 AM |
Insurance |
5 |
Jerry |
Pinto |
650000 |
01FEB1312.00.00 AM |
Insurance |
6 |
Philip |
Mathew |
750000 |
01JAN1312.00.00 AM |
Services |
7 |
TestName1 |
123 |
650000 |
01JAN1312.00.00 AM |
Services |
8 |
TestName2 |
Lname% |
600000 |
01FEB1312.00.00 AM |
Insurance |
Table: Incentives
Employee_ref_id |
Incentive_date |
Incentive_amount |
1 |
01-FEB-13 |
5000 |
2 |
01-FEB-13 |
3000 |
3 |
01-FEB-13 |
4000 |
1 |
01-JAN-13 |
4500 |
2 |
01-JAN-13 |
3500 |
Questions
- Write a UDF to return no of employees joined in the month of January.
- Write a UDF to return department wise maximum salary from employee table order by salary ascending.
- Write a UDF to return employee details from employee table if data exists in incentive table
Note:
- Upload screenshots containing query and its output in either jpg or png format.
- Name of screenshot file name must be Question No. i.e. 1.jpg or 1.png.
- Optional questions are not required to submit.