Problem
Question I
i. Create an EmployeeLog Table that will store auditing information for Employees table. Audit table to store:
o EmployeeID
o FirstName
o LastName
ii. Create a Trigger that will fire on the Update of employee FirstName. Whenever the Customer name will be updated, a new record will be inserted into the EmployeeLog Table.
iii. Write an Update Statement that will execute the update trigger on the Employee table.
Question II
Write a Query to display the following
Columns:
SupplierName(Company Name)
ProductName
Product UnitPrice
Filter: List all the products supplied by the Supplier starting with the letter 'N'
Sort: Sort the result in Descending order of Supplier Name, ProductName
Question III
i. Write a Query to list the Number of Products supplied by the Supplier.
ii. Columns: CompanyName, NunberOfProducts
iii. Filer: Select suppliers who are from Germany
Question IV
i. Write a SQL Statement that will create a new user name "John" in NorthWind database with Password "..3@".
ii. Grant read and write permission for Products Table to John.
Question V
i. Create Function Get_All_Suppliers which will input the City and Country parameters and will return Company Name for all the suppliers who belong to the input criteria in the function.
ii. Show the execution of the function with the help of the SQL statement.