Section B- Practical(60 Marks}
(NOTE:UseSQLServer Management System(SSMS}on your computer for 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 VehicleRegistration using the fields (RegistrationNo, Make,
VehicleCategory, FuelType, MainColour, DateOJRegistration) provided. Choose relevant data
types and include one primary key.
Question 2
[5 Marks]
Write a statement to create a procedure which adds a new vehicle record (values of your choice}
to the VehicleRegistration table. Create a statement to invoke the procedure, and a statement to
verify that the vehicle was successfully added.
Question 3
[10 Marks]
Modify the statement in Question 2 to allow the INSERTto be inserted five times. No repetition
of the same statement. Create a statement to invoke the procedure, and a statement to verify
that the employee was successfully added.
Question 4
[9 Marks]
Write a statement to create a procedure which test input and output parameters. Your
procedure should accept the registration number, and then output the make of the vehicle.
Invoke the procedure to test the input value, and the output value.
Question 5
[7 Marks]
Write a statement to create a procedure which accepts the FuelType and RegistratioNo as input.
The procedure should update the FuelType with the one inputted, only where the registration
number matches the one inputted. Invoke the procedure with test values. Test whether the
update was successful.
Question 6
[7 Marks]
Write a statement to create a procedure testing if the fuel is Diesel then it should print "The
vehicle is Diesel', else if the fuel is Petrol, than it should print "The vehicle is petrol". Invoke the
procedure to test the procedure.
Question 7
[3 Marks]
Write a statement to create a procedure which performs transactions.The statement must
delete all vehicles where the make is Nissan in the VehicleRegistration table; perform a
ROLLBACKTRANSACTION.Create a statement to verify that the transactionwas successfulor
not.
2