Question: Write an SQL statement to create a view named ProjectInfoView that displays the ProjectName, Department (of the project), FirstName, LastName, and Hours Worked of
Write an SQL statement to create a view named ProjectInfoView that displays the ProjectName, Department (of the project), FirstName, LastName, and Hours Worked of the employees who worked on the project. After the view is created, write an SQL SELECT statement to query the view and attach the screenshot of the result in the report. Write a stored procedure ProjectEmpSearch that takes the project name as the input and returns the first name, last name, and hours worked of the employees who worked on the project by using ProjectInfoView. Call the procedure using the project name '2019 Q3 Production Plan'. Attach the screenshot of the procedure call result in the report. Write a function dbo.ProjectCost that takes the project name and hourly rate as the input and returns the project labor cost (multiply the hourly rate by the total hours worked on the project), by using Projectinfo View. Use an SQL statement to call the function to display the labor cost of each project with 35.0 as the hourly rate. Give an appropriate column name to the computed results and remove duplicate rows if applicable. Attach the screenshot of the function call result in the report.
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
Create View ProjectInfoView code CREATE VIEW ProjectInfoView AS SELECT PProjectName PDepartment EFir... View full answer
Get step-by-step solutions from verified subject matter experts
