SectionB- Practical(60 Marks)
(UseSQLServer Management System(SSMS}on your computerfor this section)
Instructions: Copy and Paste your final code onto notepad and save it on the exam drive (z).
The drive is the drive with your student number.
Question 1
[4 Marks]
Create a table named EMPLOYEE_SALARuYsing the fields (Employee_/0, LastName, FirstName,
Title, Salary, and Gender). Choose relevant data types and include one primary key.
Question 2
[10 Marks]
Write statements to create a procedure that adds an employee record (The value of
Employee_ld is 1, while the rest of the values are your choice) to the EMPLOYEE_SALARtYable.
Make use of variables to INSERTthe values rather than hardcoded values. Create a statement to
invoke the procedure, and a statement to verify that the employee was successfully added.
Question 3
[7 Marks]
Write a statement to modify the procedure created in Question 2. Make use of parameters to
add an employee record (The value of Employee_ld is 2, while the rest of the values are your
choice) to the EMPLOYEE_SALARtYable. Create a statement to invoke the procedure, and a
statement to verify that the employee was successfully added.
Question 4
[10 Marks]
Write a statement to create a procedure that accepts an Employee ID as input. Two conditions
should be added: firstly test if the first Employee ID entered in Question 2 matches the value
inputted, and their salary is incremented with a 500 bonus, and the bonus is printed; Secondly
test in the second Employee ID entered in Question 3 matches the value inputted, and their
salary in incremented with 1000 bonus, and the bonus is printed.
Invoke the procedure to test the procedure.
Question 5
[7 Marks]
Write a statement to create a procedure that accepts an input value. Two conditions should be
tested for the values Mr and Dr. If none of the values are met, display the text "The title does not
exist". Invoke the procedure to test the procedure.
Question 6
[2 Marks]
Transform the procedure written in Question 5 to demonstrate the usage of XML.
Question 7
[7 Marks]
Write a statement to display the title of the employees five times. Please do not retype the
same statement. Invoke the procedure to test the procedure.
2