0% found this document useful (0 votes)
4 views

Functions Lab2

The document outlines a series of tasks involving the creation of scalar and multi-statement table-valued functions related to employee management. These functions include calculating annual salary, classifying experience levels, determining bonus eligibility, calculating employment duration, evaluating department performance, and summarizing departmental statistics. Each function is designed to handle specific employee data and provide insights into salary and performance metrics.

Uploaded by

me368682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Functions Lab2

The document outlines a series of tasks involving the creation of scalar and multi-statement table-valued functions related to employee management. These functions include calculating annual salary, classifying experience levels, determining bonus eligibility, calculating employment duration, evaluating department performance, and summarizing departmental statistics. Each function is designed to handle specific employee data and provide insights into salary and performance metrics.

Uploaded by

me368682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Q1.

Create a scalar function that calculates an employee’s annual salary based on their
monthly salary.

Q2.

Create a scalar function that classifies an employee's experience level based on their
years of service:

• Less than 2 years → 'Junior'


• 2–5 years → 'Mid-Level'
• More than 5 years → 'Senior'

Q3.

Create a scalar function that determines if an employee is eligible for a bonus based on:

• Salary < 5000 → Eligible


• Otherwise → Not Eligible

Q4.

Create a scalar function that calculates the number of days an employee has been
employed as amanager (using their hiring date).

Q5.

Create a multi-statement table-valued function that returns:


• Employee ID
• Number of projects the employee is assigned to

Q6.

Create a scalar function that evaluates department performance by taking the average
salary of all employees in the department:

• 7000 → 'High Performing'


• 4000–7000 → 'Moderate'
• < 4000 → 'Needs Improvement'

Q7.

Create a multi-statement table-valued function that returns for each department:

• Department name
• Total number of employees
• Average salary

You might also like