Professional Documents
Culture Documents
1. Create a database called AdvancedTech_SQL_FinalTest and run below script to create database
schema (or run AdvancedTech_SQL_FinalTest_Script.sql file in the same order with this
documentation).
Fulfills:
- If there is a record in dbo.Employee table which match with EmployeeID parameter then update
that record with the parameters.
- If EmployeeID parameter doesn't exists in dbo.Employee table, insert a new record with
parameters.
3. Write an SQL stored procedure called SP_DeactivateProduct which given a product Id that is
currently active, will deactivate that product
4. Write:
- A SQL function that returns total hours worked for a specific employee.
- Then, write a SQL SELECT statement which display each employee's name, payrolldate, and
total hours worked using above function.
5. Write a trigger which prevents user inputs a date of birth later than current date or HourlyWage is
negative number.