INF3707 Examination
INF3707 Examination
OCT/NOV 2022
INF3707
Duration: 2 hours
Total marks: 100
Examiners:
First: Dr B. Chipangura
Second: Dr L. Motsi
External: Dr G. Toko
This is a closed book examination, under IRIS invigilation. Unisa exam policy applies.
Instructions to students
1. Answer all questions in the given order.
2. You are not allowed to use Mobile devices, Calculators or Oracle XE during this exam.
3. Study the tables in Annexure A.
4. Students must upload their answer scripts in a single PDF file (answer scripts must not be
password protected or uploaded as “read only” files.)
5. NO emailed scripts will be accepted.
6. Students are advised to preview submissions (answer scripts) to ensure legibility and that
the correct answer script file has been uploaded.
7. Students are permitted to resubmit their answer scripts should their initial submission be
unsatisfactory.
8. Incorrect file format and uncollated answer scripts will not be considered.
9. Incorrect answer scripts and/or submissions made on unofficial examinations platforms
(including the invigilator cellphone application) will not be marked and no opportunity will
be granted for resubmission.
10. Mark awarded for incomplete submission will be the student’s final mark. No opportunity
for resubmission will be granted.
11. Mark awarded for illegible scanned submission will be the student’s final mark. No
opportunity for resubmission will be granted.
12. Submissions will only be accepted from registered student accounts.
13. Students who have not utilised the IRIS invigilation tools will be subjected to disciplinary
processes.
14. Students suspected of dishonest conduct during the examinations will be subjected to
disciplinary processes. UNISA has a zero tolerance for plagiarism and/or any other forms
of academic dishonesty.
15. Students are provided 30 minutes to submit their answer scripts after the official
examination time. Submissions made after the official examination time will be rejected by
the examination regulations and will not be marked.
16. Students experiencing network or load shedding challenges are advised to apply together
with supporting evidence for an Aegrotat within 3 days of the examination session.
Students experiencing technical challenges, contact the SCSC 080 000 1870 or email
[email protected] or refer to Get-Help for the list of additional contact numbers.
[Turn over]
Open Rubric
2 INF3707
OCT/NOV
Question 1 20 marks
Choose the most applicable answers and write in your on your answer sheet. For example, 1.1 A,B, C,D
1.3 Which three (3) SQL statements would display the value 2190.55 as $1, 890.55? (3 marks)
A. Select to_char(2190.55,’$0G000D00’ from dual;
B. Select to_char(2190.55, ‘$9,999V99’) from dual;
C. Select to_char(2190.55, ‘$99,999D99’) from dual;
D. Select to_char(2190.55, ‘$99G999V99’) from dual;
E. Select to_char(2190.55, ‘$9,999V99’) from dual;
1.4 If a column has high selectivity or cardinality, which index type is most appropriate for that column?
(2 marks)
A. IOT
B. B-tree
C. Bitmap
D. Function based index
[Turn over]
3 INF3707
OCT/NOV
1.5 Which statement adds a constraint that ensures the LASTNAME column of the CUSTOMERS table of the
JustLee Books database holds a value? See structure of CUSTOMERS below. (2 marks)
1.6 Which of the following keywords must have been included during the creation of a FOREIGN KEY constraint
to allow a row from the parent table to be deleted, even if it is referenced by a row in the child table? (1 mark)
A. CASCADE
B. AUTO REMOVE
C. ON DELETE CASCADE
D. NONE OF THE ABOVE
[Turn over]
4 INF3707
OCT/NOV
Which of the following three(3) statements are true about the SQL statement. (3 marks)
A. It releases the storage space used by the table
B. It does not release the storage space used by the table
C. You can roll back the deletion of rows after the statement executes
D. You cannot roll back the deletion of rows after the statement executes
E. An attempt to use DESCRIBE on the BOOKS table after the TRUNCATE statement executes will
display an error
F. You must be the owner of the table or have DELETE ANY TABLE system privilege to truncate the
BOOKS table.
Question 2 30 Marks
2.1 The following SQL code creates a table that keeps record of food products and checks for their
expiry dates.
Create an SQL statement to insert the following data into the MyCustomer01 table (customer# is
1000; First_name is John; Last_name is Smith). (4 marks)
2.3 The Database Administrator wants to grant all users with query privileges on the MyCustomer01
table. Write an SQL statement that accomplishes this? (2 marks)
2.4 What does the following query do? Describe the output. (2 marks)
[Turn over]
5 INF3707
OCT/NOV
Write a query that lists only the last four digits of the contact person's phone number at Publish Our
Way? (3 marks)
2.6 Based on the data extracted from the BOOKS table of the JustLee database, see table below, write
a query that displays 5 percent of the books with the highest retail price. (4 marks)
2.7 Examine the structure of the ORDERS table of the Justlee Books given below.
Based on the ORDERS table of the JustLee Books database, you want to find the value of the
total shipment of all the orders for each year and you issue the following command:
2.8 Examine the data extracted from the CUSTOMERS table of the JustLee books database, see table
below.
Write a query to determine the total number of customers who were referred by other customers?
(4 marks)
Question 3 30 marks
3.2 The MyCustomers03 table does not have a primary key, make CUSTOMER# the primary key.
(5 marks)
3.3 Insert data into the MyCustomers03 table based on the columns of the CUSTOMERS table of the
JustLee Books, see Annexture A for table structure of the CUSTOMERS table. (6 marks)
3.4 The MyCustomers03 table does not have the columns for capturing the client’s e_mail address as
well as the the Province. Add the two columns to the MyCustomers03 table. (5 marks)
3.5 Create a bitmap index and name it my_customers_state_idx on the MyCustomers03 table to
speed up queries for searching customers based on their province of residence. Verify that the index is
created and then delete the index. (4 marks)
[Turn over]
7 INF3707
OCT/NOV
Question 4 20 marks
4.1 Determine which books customer Jake Lucas purchased. Perform the search using the customer name, not the
customer number. If he has purchased multiple copies of the same book, duplicate the results. Generate the report
using the (JOIN…USING) keywords. Refer to the tables in Annexure A. (5 marks)
4.2 Determine the total profit generated by the book purchased on order 1002. Display the book title and profit.
The profit should be formatted to display a dollar sign and two decimal places. Consider that the customer might
not pay the full retail price and each item ordered can involve multiple copies. Refer to the tables in Annexure A.
(5 marks)
4.3 Determine which books were shipped to the same state as order 1014. Use subqueries to answer the question.
Refer to the tables in Annexure A. (5 marks)
4.4 Determine the total profit generated by sale to customer 1017. Note that quantity should be reflected in the
profit calculation. Refer to the tables in Annexure A. (5 marks)
The End
©
UNISA