INF3707 Examination
INF3707 Examination
INF3707 Examination
UNIVERSITY EXAMINATIONS
OCTOBER 2024
INF3707
Instructions:
• This paper has Annexture A containing the JustLee database tables.
• This is a closed-book exam.
• Answer all questions.
• The marks for each question are given in brackets next to the question.
• Answer the questions in order. If you want to answer a question later, leave a blank space.
• You are not allowed to use mobile devices, calculators, the Internet, or Oracle XE during
this exam.
• Pledge that you have not given or received aid on this examination (You must respond to
this pledge when submitting your assignment.)
• Students are required to use the IRIS invigilator.
[Turn over]
Open Rubric
INF3707/OCT
withheld. For examinations using the IRIS invigilator system, IRIS must be recorded
throughout the duration of the examination until the submission of the examination scripts.
10. Students have 48 hours from the date of their examination to upload their IRIS invigilator
results. Failure to do so will result in students deemed to have not utilised the proctoring
tools.
11. Students suspected of dishonest conduct during the examinations will be subjected to
disciplinary processes. Students may not communicate with any other person or request
assistance from any other person during their examinations. Plagiarism is a violation of
academic integrity and students who plagiarise, copy from published work or Artificial
Intelligence Software (eg ChatGPT) or online sources (eg course material), will be in
violation of the Policy on Academic Integrity and the Student Disciplinary Code and may be
referred to a disciplinary hearing. Unisa has zero tolerance for plagiarism and/or any other
forms of academic dishonesty.
12. Listening to audio (music) and using audio-to-text software is strictly prohibited during your
examination session unless such usage of the software is related to a student’s assistive
device that has been declared. Failure to do so will be a transgression of the Unisa
examination rules, and the student's marks will be withheld.
13. Students have 30 minutes to submit their answer scripts after the official examination time.
Students who experience technical challenges should report the challenges to the SCSC
on 080 000 1870 or their College exam support centres (refer to Get help during the
examinations by contacting the Student Communication Service Centre [unisa.ac.za])
within 30 minutes. Queries received after 30 minutes of the official examination duration
time will not be responded to. Submissions made after the official examination time will be
rejected according to the examination regulations and will not be marked. Only
communication received from your myLife account will be considered.
14. Nonadherence to the processes for uploading examination responses will not qualify the
student for any special concessions or future assessments.
15. Queries that are beyond Unisa’s control include the following: a. Personal network or
service provider issues
b. Load shedding/limited space on a personal computer
c. Crashed computer
d. Non-functioning cameras or web cameras.
e. Using work computers that block access to the myExams site (employer firewall
challenges)
f. Unlicensed software (eg licence expires during exams)
Students experiencing the above challenges are advised to apply for an aegrotat and
submit supporting evidence within ten days of the examination session. Students will not
be able to apply for an aegrotat for a third examination opportunity.
Postgraduate/undergraduate students experiencing the above challenges in their second
examination opportunity will have to reregister for the affected module.
16. Students suspected of dishonest conduct during the examinations will be subjected to
disciplinary processes. UNISA has zero tolerance for plagiarism and/or any other forms of
academic dishonesty.
17. 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.
2
[Turn over]
INF3707/OCT
Question 1.1:
When you code a calculated value in a SELECT clause, the expression for the calculated value can
include which of the following. (2 marks)
A. arithmetic operators only
B. arithmetic operators and functions only
C. arithmetic operators, comparison operators, and functions only
D. arithmetic operators, comparison operators, logical operators,
and functions
Question 1.2:
Assume that the Books table has a column named Cost. Which of the following SELECT clauses
would you use to assign an alias for calculating the total cost of books? (2 marks)
A. SELECT cost LIKE total from Books;
C. SELECT cost AS total from Books;
D. SELECT cost:total from books;
D. SELECT cost(invoice_total) from Books
Question 1.3:
In a join, column names need to be qualified only. (2 marks)
A. in inner joins
B. in outer joins
C. when the code is confusing
D. when the same column names exist in both tables
Question 1.4:
Which of the following statements is not true about the USING keyword? (2 marks)
A. you use it to simplify the syntax for joining tables
B. you code a USING clause in addition to an ON clause
C. it can be used with inner or outer joins
D. the join must be an equijoin
3
[Turn over]
INF3707/OCT
Question 1.5:
Assuming that the table name and the column names are spelled correctly, what is wrong with the
following INSERT statement? (2 marks)
INSERT INTO invoices(vendor_id, invoice_number, invoice_total,
payment_total, credit_total,terms_id, invoice_date, invoice_due_date)
VALUES (97, '456789', 8344.50, 0, 0, 1, '2022-08-31')
Question 1.6
Which of the following clauses are used to suppress duplicates in a SELECT statement? Choose the
best answer. (2 marks)
A. INTERSECT, DISTINCT
B. DUPLICATE, INTERSECT
C. DISTINCT, UNIQUE
D. UNIQUE, INTERSECT
Question 1.7
Determine the output of the query below: (2 marks)
Select (100-25)/15*(20-3)
From dual;
A. 0.294
B. -85
C. 63.67
D. 85
Question1. 8
Which of the following options allow a user to grant system privileges to other users? (2 marks)
A. WITH ADMIN OPTION
B. WITH GRANT OPTION
C. ASSIGN ROLES
D. SET ROLES
Question 1.9
If a PRIMARY KEY constraint named ORDERITEMS_PK exists for the ORDER# and ITEM# columns
of the ORDERITEMS table, which of the following commands will disable the constraints? (2 marks)
a. ALTER TABLE orderitems DISABLE PRIMARY KEY CONSTRAINT
b. ALTER TABLE orderitems DISABLE CONSTRAINT oderitems_pk
c. ALTER TABLE orderitems REMOVE PRIMARY KEY CONSTRAINT
d. ALTER TABLE orderitems MODIFY PRIMARY KEY CONSTRAINT DISABLE
4
[Turn over]
INF3707/OCT
Question 1.10
Examine the structure of the CUSTOMER table created below:
Question 1.11
Which four statements are true regarding views? (8 marks)
A. Data can’t be added to a view column containing an expression.
B. Only simple views can use indexes existing on the underlying tables.
C. Both simple and complex views can use indexes existing on the underlying tables.
D. Complex views can be created only on multiple tables that exists in the same schema.
E. Complex views can be created on multiple tables that exist in the same or different
schemas.
F. A row with a view cannot be deleted through a view if the view definition contains the
DISTINCT keyword.
G. If a view is dropped with the DROP VIEW command, the data in the original table will get
affected.
H. DML operations are permitted on non-key-preserved tables.
Question 1.12
You issued the following command:
Question 1.13
Which three SQL statements would display the value 2190.55 as $2, 190.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;
5
[Turn over]
INF3707/OCT
Question 1.14
You want to create a SALES table with the following column specifications and data types:
• SALESID: Number
• STOREID: Number
• ITEMID: Number
• QTY: Number, should be set to 1 when no value is specified.
• SLSDATE: Date, should be set to current date when no value is
specified.
• PAYMENT: Character up to 30 characters, should be set to CASH when no
value is specified
6
[Turn over]
INF3707/OCT
Question 1.15
Which statement adds a constraint that ensures the Lastname column of the CUSTOMERS table of
the JustLee Books database holds a value? (3 marks)
Question 2
John is an Accountant at JustLee Books and require access to the OrderItems table. To provide John
with the access to the database, do the following activities:
Question 2.1
Create an account for John and provide him with a password that expires. (3 marks)
Question 2.2
Provide John with the role of an accountant. (2 marks)
Question 2.3
John should have the rights to grant other employees with access priviledges to the OrderItems table.
(4 marks)
7
[Turn over]
INF3707/OCT
Question 3
Examine the structure of the CUSTOMERS table extracted from the JustLee Books, and answer the
following question.
Create a query that uses self join to list all cities that have more than one customer, along with the
customer details such as CUSTOMER#, LASTNAME, AND CITY. (6 marks)
Question 4
Determine which books customer Jake Lucas purchased. Perform the search using the
customer’sname, rather than 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
Annexture A for database tables for the JustLee Books. (5 marks)
Question 5
Consider the following table that keeps track of vendors of the JustLee Books. The table contains five
columns: Vendor_id, Vendor_name, Address, Zip_code and Phone.
Quesion 5.1
Write the SQL code that creates the Vendors database table. (10 marks)
Question 5.2
The Vendor_id column is not currently set as a primary key. Write an SQL query to alter the table and
make Vendor_id the primary key. (3 marks)
Question 5.3
The vendor table does not have columns for capturing the account number and the email of each
vendor. Add the two new columns to the table, Acc_number with a data type VARCHAR2 (10) and
email VARCHAR2 (5). Both these new columns should be Not Null. (6 marks)
8
[Turn over]
INF3707/OCT
Question 5.4
The size of the email coloumn is too small to capture a meaningful email address. Create an SQL
query to enlarge the size from VARCHAR2(5) to VARCHAR(20). (3 marks)
Question 5.5
Insert the following data into the Vendors table. (10 marks)
Question 5.6
Delete the vendor with Vendor_id 1002 from the Vendors table. (3 marks)
The end
© UNISA 2024
9
[Turn over]
i
Annexure A
Describe Customers
Describe Orders
Describe orderitems
Describe books
The end
© UNISA 2024