DBF510S - DATABASE FUNDAMENTALS - 2ND OPP - JULY 2023


DBF510S - DATABASE FUNDAMENTALS - 2ND OPP - JULY 2023



1 Page 1

▲back to top


nAmlBIA UnlVERSITY
OF SCIEn CE TECHn OLOGY
FACULTV OF COMPUTING AND INFORMATICS
DEPARTMENTOF SOFTWAREENGINEERING
QUALIFICATION:BACHELOROF COMPUTERSCIENCE,BACHELOROF INFORMATICS,BACHELOR
OF CYBERSECURITY,BACHELOROF GEOINFORMATICS,BACHELOROF LAND ADMINISTRATION
QUALIFICATIONCODE:07BCMS, 07BAIT, 07BCCS,07BGEI,
07BLAM, 06DPRS
LEVEL:5
COURSE:DATABASEFUNDAMENTALS
COURSECODE: DBFSl0S
DATE:JULY2023
PAPER:THEORY
DURATION: 2 HOURS
MARKS: 70
SUPPLEMENTARY/SECONDOPPORTUNITYEXAMINATION QUESTION PAPER
EXAMINER:
MRS SHILUMBE CHIVUNO-KURIA
MODERATOR:
MR GEREONKOCHKAPUIRE
THIS QUESTION PAPER CONSISTS OF 5 PAGES
(Including this front page)
INSTRUCTIONS TO STUDENTS
1. Attempt all Questions.
2. All questions have to be answered in the Answer Booklet. Clearly indicate the section and
question number for each answer.
3. The allocation of marks is an indication of the extent of the expected answer. Answering more
than expected does not result in higher marks. Keywords alone are not enough.
4. There are no books, notes or any other additional aids allowed in the examination.

2 Page 2

▲back to top


SECTIONA:
Question 1:
[Marks: 20]
Multiple ChoiceQuestions
[10 Marks]
• Answer all the questions in the answer booklet that has been provided.
• Select the best answer.
1. Tables in second normal form (2NF):
a) eliminate all hidden dependencies.
b) eliminate the possibility of an insertion anomaly.
c) have a composite key.
d) have all non-key fields depend on the whole primary key.
2. You would use this SQLcommand to remove a table and all its contents from the database
schema?
a) DROPTABLE
b) GROUP BY
c) INDEX BY
d) SEQUENCEBY
3. What is a Schema?
a) A very high level, conceptual overview of the database.
b) Collection of tables in the database.
c) The collection of saved queries.
d) The systems and processes contained in the DBMS supporting the administration of
the data.
4. An UPDATEquery:
a) is used to add new records to a table.
b) is used to change existing values within a table.
c) is used to change the structure of the database.
d) is used to determine what has changed in the database since the last benchmark
process.
5. Which of these describes a major advantage in using databases for storing data?
a) The data have a better chance of being available for the user in an accurate, integral
form.
b) All of the data is stored in one place and therefore more vulnerable to loss or
destruction.
c) Organisational procedures may make it difficult for users to access data.
d) Data retrieval cannot be enhanced for a single application.
6. A -------
consists of linked tables that form one overall data structure.
Page 11

3 Page 3

▲back to top


a) database system
b) data structure
c) file processing system
d) file-oriented system
7. Which of these is an example of an entity?
a) Patient.
b) a patient's name.
c) an employee's ID.
d) all of the above.
8. What is the impact of not including a JOIN command when using multiple tables in a query?
a) All records in each table are associated with all records in the other tables.
b) The foreign keys in each table are linked to the primary keys in the other tables.
c) The primary keys in each table are joined together.
d) The query will not work - an error is generated.
9. In a crow's foot cardinality notation, a double bar indicates:
a) two
b) many
c) zero
d) one and only one
10. If you multiply one by 100, then you add 100, and then multiply the result by null. The result
will be:
a) an error.
b) 100.
c) 200.
d) Null.
Question 2
[10 marks]
Indicate whether the following statements are True or False in your answer booklet.
ID Statement/D~scription
,-
.. ..
True False
1 A primary key prevents nulls from being used in the column.
2 A SELECTclause shows the output you want to retrieve.
3 UNIQUE is used to eliminate duplicates from the results.
4 A multivalued attribute can have more than one value
associated with the key of the entity.
5 A weak entity is not dependent on the existence of another
entity for its primary key.
6 Denormalization is the process of decomposing relations with
anomalies to produce smaller, well-structured relations.
Page I 2

4 Page 4

▲back to top


7 Data redundancy leads to a waste of storage space because one
has duplicate data.
8 The MODIFY clause changes values in a table.
9 Values that are specified by the BETWEENoperator are
inclusive.
10 You can change a column's datatype, size, and default value by
using the ALTERstatement.
SECTIONB: CONCEPTS
1. Using an example explain what a composite key is.
[Marks: 10)
[2 Marks]
2. Explain the one use of the DESCkeyword and give an example.
[2 Marks]
3. Name and describe the types of anomalies and give a practical example of each.
[6 Marks]
SECTIONC: COMPREHENSION
[Marks: 40)
1. Given the following scenario create an appropriate ERdiagram. Include at least 3 attributes
and 1 primary Key for each entity. Include the cardinality and relationships. Use Crow's Foot
Notation.
[17 Marks]
A hospital has a set of patients and a set of medical doctors. Information gathered from the
patient includes their id#, name, date seen by the doctor. The doctor has a doctor#, name
and specialisation. A doctor can perform one or more tests on a single patient. A test
consists of the testname, testdate, result. A doctor can perform one or more tests on many
patients in a given day.
2. Write an SQL statement to create a new table named CHOMMIE with attributes for ID,
First_name, last_name, birthday, and Cellphone#. Decide on your own about reasonable
column names and data types and include a primary Key.
[7 Marks]
3. Write a query to Insert five records containing information about people you know, at least
one person should have a last_name of 'Zulu'.
[5 Marks]
4. Write a query to display all the records, ordered by last_name in descending order.
[3 Marks]
5. Your friend with the last_name 'Zulu' has changed their cellphone number to 0812345678.
Write a query to make this modification in the Chommie table.
[3 Marks]
Page I 3

5 Page 5

▲back to top


6. Write a query to verify that the changes have been made in the Chommie table.
[2 Marks]
7. Zulu no longer wants to be your friend. Write a query to delete Zulu from the table.
[3 Marks]
*********** ***************** Endof the Paper***********************************
Page I 4