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

Assignment 9

The document outlines five questions related to creating stored procedures in a database. These procedures involve retrieving employee details by department, calculating total project budgets by department, listing employees by project, counting employees and budgets by department, and assessing project budget status. Each question specifies the required input parameters and the expected result sets to be returned.

Uploaded by

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

Assignment 9

The document outlines five questions related to creating stored procedures in a database. These procedures involve retrieving employee details by department, calculating total project budgets by department, listing employees by project, counting employees and budgets by department, and assessing project budget status. Each question specifies the required input parameters and the expected result sets to be returned.

Uploaded by

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

Om Ashok Dhinoja dhinoja.o@northeastern.

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

You might also like