DPG621S - DATABASE PROGRAMMING PRACTICAL - 2ND OPP SUPL - JAN 2023


DPG621S - DATABASE PROGRAMMING PRACTICAL - 2ND OPP SUPL - JAN 2023



1 Page 1

▲back to top


nAmI BIA Uni VE RSITY
OF SCIEnCE Ano TECHn OLOGY
FACULTY OF COMPUTING AND INFORMATICS
SCHOOL OF COMPUTING
DEPARTMENTOF SOFTWAREENGINEERING
QUALIFICATION: BACHELOROF COMPUTERSCIENCE;BACHELOROF INFORMATICS;BACHELOR
OF GEOINFORMATION TECHNOLOGY
QUALIFICATION CODE: 07BCMS; 07BACS
07BAIT; 07BAIF; 07GITB
LEVEL: 6
COURSE: DATABASEPROGRAMMING
COURSE CODE: DPG621S
DATE: JANUARY 2023
SESSION: 2 (PRACTICAL)
DURATION: 2 HOURS
MARKS: 60
SECOND OPPORTUNITY/SUPPLEMENTARY EXAMINATION QUESTION PAPER
EXAMINER:
MR GEREONKOCH KAPUIRE
MODERATOR:
PROFJOSEQUENUM
THIS QUESTION PAPER CONSISTS OF 2 PAGES
(Excluding this front page)
INSTRUCTIONS
1.
Answer all questions.
2.
When writing take the following into account: The style should inform than impress, it
should be formal, in third person, paragraphs set out according to ideas or issues and
the paragraphs flow in a logical order. The information provided should be brief and
accurate.
3.
Please, ensure that your writing is legible, neat and presentable.

2 Page 2

▲back to top


3 Page 3

▲back to top


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

4 Page 4

▲back to top


5 Page 5

▲back to top


Question 8
[3 Marks]
Create a table called VehicleAudit to record changes in the main table. The table should
contain the fields (RegisterNumber, Make).
Question 9
[10 Marks]
Write a statement to create a trigger. The trigger keeps logs after a row is inserted in the
VehicheRegistration table. For audit logs, the registration number and make is inserted in a table
called VehicleAudit. Print a message '"after insert trigger" after insertion. Create a statement to
verify that the trigger is fired successfully.
Question 10
Write a statement to delete the trigger created in Question 9.
[2 Marks]
<<<<<<End of Practical Exam Paper>>>>>
3

6 Page 6

▲back to top


.,