INF2603 October November 2024

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

UNIVERSITY EXAMINATIONS

OCTOBER/NOVEMBER 2024

INF2603

Database 1

100 Marks

Duration 2 Hours

EXAMINERS:
FIRST: Mr ME Bogopa
SECOND: Mrs CL Hlengwa

This paper consists of 7 pages.

Instructions:

1. Answer all questions.


2. The marks for each question are given in brackets next to the question.
3. Please answer the questions in the order in which they have been set.
4. You signed an Honesty Declaration. This means you will complete this paper on
your own and without help.
5. This final pdf document should not be password-protected.
6. Convert all the pages into a single PDF file.
7. Poorly scanned and hard-to-read answer files will result in a zero mark.
8. Once your document meets all the criteria, then you can upload the file to myAdmin.

GOOD LUCK.
2
INF2603
OCTOBER/NOVEMBER 2024

QUESTION 1 [20 marks]


Carefully select the most correct answer to each of the following questions. Please write
down only the question number and corresponding to it put the correct option’s
number (e.g. Qu. 11. (e)):

For question 1 to 5: Indicate whether the statement is true or false. (2 marks each):

1. Overlapping subtypes are subtypes that contain nonunique subsets of the


supertype entity set; that is, each entity instance of the supertype may appear in
more than one subtype.
a. True
b. False

2. Within a specialisation hierarchy, every subtype can have many supertypes to


which it is directly related.
a. True
b. False

3. If Capricon TVET College had some departments that were classified as “research
only,” they would not offer courses; therefore, the COURSE entity would be
independent to the DEPARTMENT entity.
a. True
b. False

4. A cloud database is a database that is built, deployed, and accessed in a cloud


environment, such as a private, public, or hybrid cloud.
a. True
b. False

5. The multivalued type of attribute cannot be created in a DBMS.


a. True
b. False

TURN OVER
3
INF2603
OCTOBER/NOVEMBER 2024

For question 6 to 10: Identify the choice that best completes the statement or answer the
question. (2 marks each):

a. CHECK
b. HAVING
c. EXISTS
d. UPDATE
e. LIKE
6. Validates data in an attribute.
7. Checks whether a subquery returns any rows.
8. Restricts the selection of grouped rows based on a condition.
9. Modifies an attribute’s values in one or more table’s rows.
10. Checks whether an attribute value matches a given string pattern

TURN OVER
4
INF2603
OCTOBER/NOVEMBER 2024

QUESTION 2 [22 marks]

a. What is the difference between a column constraint and a table constraint? (4)

b. Explain what is a disjoint subtype? And give an example. (4)

c. What three join types are included in the OUTER JOIN classification? (6)

d. What is a strong (or identifying) relationship? (2)

e. Why is a table whose primary key consists of a single attribute automatically in 2NF
when it is in 1NF? (2)

f. What is metadata? (2)

g. Explain what is physical independence in data models? (2)

QUESTION 3 [18 marks]

University of Botswana Course Enrolment Database

UniBo database stores information about students, courses, and enrolments. Initially, the
data might be stored in a single table like this:

Table 3.1: University Table


StudentID StudentName CourseID CourseName Instructor EnrolmentDate
1 Thato 101 Math Dr. Moape 2024-01-15
2 Lucas 102 History Dr. Mtsweni 2024-01-16
1 Thato 103 Physics Dr. Chipa 2024-01-17
3 Sam 101 Math Dr. Moape 2024-01-18

Given that information, answer the following questions:

a. If possible, transfer the unnormalized form to first normal form. (4)


TURN OVER
5
INF2603
OCTOBER/NOVEMBER 2024

b. Using the answer to problem a, remove existing partial dependencies and


transform the relation into 2nd normal form. (6)
c. Remove transitive dependencies and transform the relations from 2nd normal form
to 3rd normal form. (8)

QUESTION 4 [20 marks]

Using the following transport business rules, draw the appropriate ERD using UML
notation for a unique e-hailing taxi service in Mpumalanga. Make sure that you include
all appropriate entities, relationships, and multiplicities:

• One driver can be assigned to multiple taxis over time, but each taxi has only one
driver at a time

• Each customer can have multiple rides, and the e-hailing services offer sharing
options for the customers

• One taxi can be used for multiple rides

• Each ride has one payment, and the customer can decide to cancel and the
payment will be reversed

QUESTION 5 [20 marks]

NOTE: All SQL syntax must be correct, missing characters will be penalized!

5.a. The Finance Department of SOUTHERN AFRICA NAZARENE UNIVERSITY stores


the Bonus field in the Employee table because a bonus is an attribute associated with
employees.

EMPLOYEE (Employee_ID, Employee_Fname, Employee_Lname, Birthdate, Dept_ID,


Bonus)

Given the structure and contents of the database shown in table above, use SQL
commands to answer questions 5.a.i-ii.

TURN OVER
6
INF2603
OCTOBER/NOVEMBER 2024

i. Write a SQL code to display the employees names, year of birth, and the bonus for
each employee. Sort the results by the employee_id as in the table below. (5)

Table 5.1:

Employee_ID EmployeeNames_BirthYears Dept_ID Bonus

90115466 Bontle Nxumalo (1982) 2305

90193377 Mpho Nkomo (1989) 2405 R24,000

90260188 Mahlako Nkomo (1984) 6605

91001132 Tshepi Phahlane (1986) 2305 R53,000

ii. Write the SQL code to delete the row for the employee who was paid R24,000 bonus.
(2)

5.b. In the following questions, you will use the data of UNISA student registration
information.

i. Write the SQL code that will create the STUDENT table provided below. This
table is a subset of the UNISA student registration database. (Note that the
DEPT_CODE is the FK to DEPARTMENT, also use your own Data
Declarations). (4)

Table 5.2: The attributes of the Student Entity

STUDENT
StudentID {PK}
DEPT_CODE {FK}
STUD_Gender
STUD_fname
STUD_lname
STUD_INITIAL
STUD_EMAIL

ii. Because you are a registered student at UNISA and you have classmates who
are your friends, please write SQL code to enter your own correct information
and also the information of anther student into the STUDENT table. That is 2
records. For the student number of your friend you can use 33339999. (4)

TURN OVER
7
INF2603
OCTOBER/NOVEMBER 2024

iii. Write a SQL code to change your email address from your mylife email
address to a Gmail address. (3)
iv. Write a SQL code to delete the STUDENT table from the database. (2)

©
UNISA 2024

TURN OVER

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy