DBF510S - DATABASE FUNDAMENTALS - 1ST OPP - JUNE 2024


DBF510S - DATABASE FUNDAMENTALS - 1ST OPP - JUNE 2024



1 Page 1

▲back to top


nAmlBIA unlVERSITY
OF SCIEnCE Ano TECHnOLOGY
FACULTY OF COMPUTING AND INFORMATICS
DEPARTMENTOF SOFTWAREENGINEERING
QUALIFICATION:BACHELOROF COMPUTERSCIENCE,BACHELOROF INFORMATICS,BACHELOR
OF CYBERSECURITYB, ACHELOROF GEOINFORMATICS,BACHELOROF LAND ADMINISTRATION
QUALIFICATIONCODE:07BCMS, 07BAIT, 07BCCS,07BGEI,
07BLAM, 06DPRS
LEVEL:5
COURSE:DATABASEFUNDAMENTALS
COURSECODE:DBFSlOS
DATE:JUNE 2024
PAPER:THEORY
DURATION: 2 HOURS
MARKS: 70
EXAMINER:
FIRSTOPPORTUNITYEXAMINATION QUESTIONPAPER
MRS SHILUMBE CHIVUNO-KURIA
MODERATOR:
DR 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


Answer ALL the questions in this paper.
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. Which of the following is NOT a type of database model?
A) Relational
B) Hierarchical
C) Network
D) Sequential
2. Which SQLcommand is used to retrieve data from a table in a database?
A)GET
B)SELECT
C) FETCH
D) RETRIEVE
3. What is normalisation in the context of databases?
A) Reducing redundancy and dependency by organizing data into tables.
B) Adding redundancy to improve data integrity.
C) Removing data from a database to increase performance.
D) Reversing the process of organizing data into tables.
4. A database schema is
A) A table that stores user data.
B) A graphical representation of a database.
C) A collection of metadata that describes the structure of a database.
D) A set of rules for optimizing database performance.
5. What is the purpose of the SQLWHEREclause?
A) To specify conditions for filtering rows.
B) To specify which columns to select.
C) To group rows that have the same values into summary rows.
D) To join multiple tables together.
6. Which of the following is NOT a valid data type in SQL?
A) Text
B) Integer
C) Float
D) Array
7. A user view in databases is:
A) What a user sees when he or she looks out the window.
B) A table or set of tables.
Page 11

3 Page 3

▲back to top


C) A logical description or some portion of the database.
D) A procedure stored on the server.
8. What is true of a distributed database?
A) Less reliable.
B) Better local control.
C) Slower response time.
D) None of the above.
9. A candidate key must satisfy all the following conditions EXCEPT:
A) The key must uniquely identify the row.
B) The key must indicate the row's position in the table.
C) The key must be nonredundant.
D) Each nonkey attribute is functionally dependent upon it.
10. A constraint between two attributes is called a(n):
A) Functional relation.
B) Attribute dependency.
C) Functional dependency.
D) Functional relation constraint.
Question 2
(10 marks]
Indicate whether the following statements are True or False in your answer booklet.
ID Statement/Description
True
1 A database management system (DBMS) is used to create,
retrieve, update, and delete data in a database.
2 Group functions include nulls in their calculations.
3 The database server executes subqueries first before the main
query.
4 In SQL,the HAVING clause is used to specify conditions for
filtering rows in a query.
5 A repository is a centralised knowledge base of all data
definitions, data relationships, screen and report formats, and
other system components.
6 In a relational database, the relationship between tables is
established through the unique naming of the different tables
involved in the relation.
7 You can roll back the DROPTABLEstatement.
8 COUNT (salary) returns the number of non-null values that are
in the column salary.
9 The symbols != and "= can also represent not equal to.
10 Values that are specified by the BETWEENoperator are not
inclusive.
False
Page I 2

4 Page 4

▲back to top


SECTIONB: CONCEPTS
[Marks: 10]
1. Explain the following terms with an example.
a)
Equijoin
b)
Enterprise data model
2. What does the term Non-Equijoin Mean?
3. Explain the difference between a database and a DBMS.
4. List any four properties of a relation.
[3 Marks]
[2 Marks]
[1 Mark]
[2 Marks]
[2 Marks]
SECTIONC: COMPREHENSION
[Marks: 40]
1.
Given the following scenario create an appropriate ER diagram. Include at least 3
attributes and 1 primary Key for each entity. Include the cardinality and relationships. Use Crow's
Foot Notation.
[15 Marks]
A social media platform allows users to create profiles, post content, and connect with other users.
Each user has a unique user ID, username, email address, and password. A User can create multiple
posts, which have a unique post ID, content, timestamp, and number of likes. A user can also follow
one or many other users.
2.
Write an SQL query to create a table called Olympic_cities using the information provided
in the table below. Choose relevant datatypes and include a primary key.
[8 Marks]
Olympic cities
Olympic no
Country
City
Recent year _held No_of _times_held
1000
Greece
Athens
2004
2
1001
France
Paris
2024
3
1002
Japan
Tokyo
2021
2
1003
Brazil
Rio de Janeiro 2016
1
1004
Australia
Sydney
2000
1
3.
Write an SQL statement that inserts all the rows as shown in the Olympic_cities table.
[5 Marks]
4.
Write a query that will verify that all the rows of data have been inserted into the
Olympic_cities.
[1 Mark]
5.
Write a query that will the average number of times the Olympics have taken place and
rename the resulting column.
[3 Marks]
Page I 3

5 Page 5

▲back to top


6.
You have noticed that the column No_of_times_held can affect the data integrity of the
table. Write a SQL statement to remove the No_of _times_held column from the Olympic_cities
table.
[3 Marks]
7.
Namibia has been selected to host the Summer Olympics in place of France this year. Write
a query to modify the Olympic_cities table to include Windhoek in Namibia in place of Paris France.
[3 Marks]
8.
Write a query to find out all the countries that have an 'e' in any of the Countries 'names.
[2 Marks]
********* ******************* Endof the Paper************ ******************* ****
Page I 4