Assignment 9
Assignment 9
edu
002832284 DMDD
Assignment – 9
Question 1) Create a stored procedure GetEmployeesByDepartment to list all employees in a specific
department. Use an input parameter for the department name. Return a result set that includes employee details
along with their department names.
1|Page
Om Ashok Dhinoja [email protected]
002832284 DMDD
Question 2) Create a stored procedure GetTotalBudgetByDepartment to calculate the total project budget
allocated for each department. Return a result set that shows each department name, city, state, and the total
budget of projects that employees in each department are working on.
2|Page
Om Ashok Dhinoja [email protected]
002832284 DMDD
Question 3 Create a stored procedure GetEmployeesByProject to retrieve all employees who have worked on a
specific project. Use an input parameter for the project name. Return a result set of employee names,
department names, job roles, and entry dates for the specified project
3|Page
Om Ashok Dhinoja [email protected]
002832284 DMDD
Question 4) Create a stored procedure GetEmployeeCountByDepartment to count the number of employees
working in each department, and total budget for each department. Return a result set with department names
and the count of employees in each department, and total budget for the department. Use two CTE or derived
table: one to calculate the employee count per department, the other to calculate the total budget.
4|Page
Om Ashok Dhinoja [email protected]
002832284 DMDD
Question 5 ) Create a stored procedure GetProjectBudgetStatus that lists all projects along with a “Budget
Status” indicating if they are “over budget” or “under budget”. This procedure takes “expected budget" as input
parameter. If the actual budget > “expected budget" then “Budget Status” shows “under budget” otherwise
“under budget”
5|Page