Dbf510s - Database Fundamentals - 1st Opp - June 2022
Dbf510s - Database Fundamentals - 1st Opp - June 2022
Mr. G. KAPUIRE
MODERATOR:
INSTRUCTIONS TO CANDIDATES
1. Answer ALL questions in ALL sections of this paper.
2. Please, ensure that your writing is legible, neat and presentable.
3. Number your answers clearly on the answer booklet provided.
4. Write your student number, study mode and group number clearly on your
answer booklet.
A. Cardinality
B. Tuple
C. Degree
D. Domain
3. Within a table, the primary key must be unique so that it will identify each row. When this
is the case, the table is said to exhibit ----- integrity.
A. Referential
B. Entity
C. Enforced
D. Key
A. Range
B. Product
C. Domain
D. Function
i. SELECT
ii. ALTER
iii. DROP
iv. DELETE
A. i, iv
B. ii, iii
C. i, ii, iii
2
D. ii, iii, iv
6.The following operation is used to update the structure of the database table.
A. Alter
B. Update
C. Change
D. None of the above
A. Key Constraint
B. Entity Integrity Constraint
C. Referential Integrity
D. None of the above
A. Dotted rectangle.
B. Diamond
C. Doubly outlined rectangle
D. None one of these
A. ONLY
B. UNIQUE
C. DISTINCT
D. SINGLE
A. SORT BY
B. ALIGN BY
C. ORDERBY
D. GROUP BY
A. Recursive
B. Ternary
3
C. Binary
D. Single
A. Derived
B. Multivalued
C. Composite
D. Comparison
A. DDL Command
B. DML Command
C. Both A and B
D. None of the above
4
You execute the SQL statement:
A. It fails because the alias name specified after the column names is invalid
B. It fails because the space specified in single quotation marks after the first two column
names is invalid
C. It executes successfully and displays the column details in a single column with only the
alias column heading
D. It executes successfully and displays the column details in three separate columns and
replaces only the last column heading with the alias
17. We want to find all Students whose name contains 'na'. Which statement will execute
successfully to get the desired output?
A. SELECT*
FROM students
WHERE first_name LIKE '%na%' OR
last_name LIKE '%na%';
B. SELECT*
WHERE first_name LIKE '%na%' OR
last_name LIKE '%na%';
C. SELECT*
FROM students
WHERE first_name LIKE '%na%';
last_name LIKE '%na%';
D. SELECT*
FROM students
first_name LIKE '%na%' OR
last_name LIKE '%na%';
5
18. Which SQL statement is used to remove data from a database?
A.DROP
B. DELETE
C. COLLAPSE
D. REMOVE
19. Which statement is true regarding the default behavior of the ORDERBY clause?
Question 1:
Question 2:
6
V. Select operator and project operator [3 marks]
Question 3:
You are a database administrator at OurBooks company. Your management board requires
your input on scenarios they have received on a possible Government client.
Based on the following scenario, determine what type of database you would recommend
and briefly explain why. [10 marks]
i. A database that supports the SAP enterprise information System and is used by all
government employees.
ii. The Ministry of health wants to send a social worker to visit patients at an old age
home. The social worker has to record set of data describing patient visits. Only
the social worker will use the database.
iii. A database that supports the work of five scientists performing research on a new
flu drug.
iv. A database that supports eight Human resources department officers to share
staff related information for all government employees.
Question 4:
i. DDL [3 marks]
ii. DML [3 marks]
iii. DCL [3 marks]
Question 1:
Table 1 PlayerDetails
Given the PlayerDetails table above (Table 1), write SQL commands/ statements to:
7
ii. Add all the records shown to the table created in (i) [5 marks]
iii. Display all the records stored in Tablel in ascending order of PlayerNumber
[3 marks]
iv. Change PlayerNumber 19's team to Liverpool [3 marks]
V. Delete all the details of the players that play for Arsenal [3 marks]
vi. Add a new player with the following details [2 marks]
Question 2:
ii. Display the EmployeelD, FirstName, Surname and salary of all employees
[5 marks]
Question 3:
Read the scenario below and answer the question that follows:
The publishing company produces books and publications on various subjects from its
branches. The company is identified by its name, company registration number and branch
code. A book title, ISBN number, edition, publication date identify a book. Subjects are
identified by subject code with a subject genre as the other attribute. An author writes books
in one particular subject and are identified by their authorlD among other attributes. Many
authors may write a book and an author can write many books. The company employs editors
who are responsible for editing one or more publications. To differentiate the editors, each
editor is assigned an editorlD and the editor records the date of editing for all publications. A
8
publication covers one of the specialist subjects and is written by a single author though an