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

The Independent Institute of Education 2017

MODULE NAME: MODULE CODE:


DATABASE INTRODUCTION DATA6211
DATABASE INTRODUCTION DATA6211d
DATABASE INTRODUCTION DATA6211p

ASSESSMENT TYPE: EXAMINATION (PAPER ONLY)


TOTAL MARK ALLOCATION: 120 MARKS
TOTAL HOURS: 2 HOURS (+10 minutes reading time)
INSTRUCTIONS:
1. Please adhere to all instructions in the assessment booklet.
2. Independent work is required.
3. Five minutes per hour of the assessment to a maximum of 15 minutes is dedicated to reading
time before the start of the assessment. You may make notes on your question paper, but not
in your answer sheet. Calculators may not be used during reading time.
4. You may not leave the assessment venue during reading time, or during the first hour or
during the last 15 minutes of the assessment.
5. Ensure that your name is on all pieces of paper or books that you will be submitting. Submit all
the pages of this assessment’s question paper as well as your answer script.
6. Answer all the questions on the answer sheets or in answer booklets provided. The phrase
‘END OF PAPER’ will appear after the final set question of this assessment.
7. Remember to work at a steady pace so that you are able to complete the assessment within
the allocated time. Use the mark allocation as a guideline as to how much time to spend on
each section.
Additional instructions:
1. This is a CLOSED BOOK assessment.
2. Calculators are allowed.
3. For multiple-choice questions, give only one (1) response per question. The marker will ignore
any question with more than one answer, unless otherwise stated. You should, therefore, be
sure of your answer before committing it to paper.

© The Independent Institute of Education (Pty) Ltd 2017


Page 1 of 9
The Independent Institute of Education 2017

Question 1 (Marks: 10)


Multiple-choice questions: Select one correct answer for each of the following. In your answer
booklet, write down only the number of the question and next to it, the number of the correct
answer.

Q.1.1 ____________exists when different versions of the same data appear separately in (1)
different places.

(1) Data decomposition


(2) Normalisation
(3) Data consistency
(4) Data redundancy

Q.1.2 Which of the following is not a function of DBA? (1)


(1) Network Maintenance
(2) Routine Maintenance
(3) Schema Definition
(4) Authorization for data access

Q.1.3 Which of the following refers to something that can be identified in the users' work (1)
environment, something that the users want to track?
(1) Entity
(2) Attribute
(3) Identifier
(4) Relationship

Q.1.4 Which of the following is a reason to model data? (1)


(1) Understand each user’s perspective of data
(2) Understand the data itself irrespective of the physical representation
(3) Understand the use of data across application areas
(4) All of the above

© The Independent Institute of Education (Pty) Ltd 2017


Page 2 of 9
The Independent Institute of Education 2017

Q.1.5 Multiplicity is the main constraint that exists on a relationship. Which two (2) (1)
constraints does it describe?

(1) Relationship and degree


(2) Cardinality and relationship
(3) Cardinality and participation
(4) Degree and cardinality

Q.1.6 An entity type whose existence depends on another entity type is called a (1)

_____ entity.
(1) Strong
(2) Weak
(3) Co-dependent
(4) Variant

Q.1.7 A category of SQL that includes commands to create database objects such as tables, (1)
indexes, and views.
(1) ANSI SQL.
(2) Data Definition Language.
(3) Structured Query Language.
(4) Data Manipulation Language.

Q.1.8 Which normal form would a table be in if it is in 2NF and contains no transitive (1)
dependencies?

(1) First Normal Form (1NF)


(2) Second Normal Form (2NF)
(3) Third Normal Form (3NF)
(4) Any of the above

© The Independent Institute of Education (Pty) Ltd 2017


Page 3 of 9
The Independent Institute of Education 2017

Q.1.9 What does the following SQL statement do? (1)

Select * From Customer Where Cust_Type = “Best”;

(1) Selects all the fields from the Customer table for each row with a customer
labelled “best”
(2) Selects the “*” field from the Customer table for each row with a customer
labelled “best”
(3) Selects fields with a “*” in them from the Customer table
(4) Selects all the fields from the Customer table for each row with a customer
labelled “*”

Q.1.10 In SQL, which special operator is used to check whether a sub query returns any (1)
rows?

(1) DISTINCT

(2) UNIQUE

(3) NULL

(4) EXISTS

Question 2 (Marks: 20)


Answer the following question below using brief answers and diagrams.

Q.2.1 Poorly designed databases usually pose a lot of challenges later in the operation of the (8)
business processes and transactions. Explain why database design is important?

Q.2.2 What is a relationship in context to tables in databases? What are the three types of (4)
relationships?

Q.2.3 Differentiate the following integrity rules, “Entity Integrity” and “Referential integrity”. (5)
Provide examples for each explanation.

© The Independent Institute of Education (Pty) Ltd 2017


Page 4 of 9
The Independent Institute of Education 2017

Q.2.4 Students can reserve many books from the library per semester. The two entities are in (3)
a (* :*) relationship. Can many-to-many be implemented in a relational database?
Provide a reason for your answers.

Question 3 (Marks: 30)


Design the database by creating an Entity Relationship Diagram (ERD) using Unified Modelling
Language (UML) notation, making sure to include attributes where necessary, relationships,
multiplicities, primary/foreign keys attributes for each entity identified.

Mark Allocation:
Entities 5 marks
Attributes (at least 2 per entity) 10 marks
Multiplicities 5 marks
Composite entity 1 mark
Primary keys 2 marks
Relationship names 5 marks
UML notation 2 marks

 A purchase order can list many line items, but a given line item can be listed by only one
purchase order.
 Purchases order details that can be considers are purchase order number, customer number,
order date, shipping date, street address, city.
 A line item can refer to only one stock item, but a given stock item can be referred to by many
line items. The relationship is optional because zero line items might refer to a given stock
item.
 Line item details can be as follows line item number, purchase order number, quantity and
discount.
 Purchase order can contain many stock items, and a stock item can be contained in many
purchase orders.
 Stock can be stock item number, description and price.

© The Independent Institute of Education (Pty) Ltd 2017


Page 5 of 9
The Independent Institute of Education 2017

 Customer can place many orders, but a given purchase order can be placed by only one
customer.
 Customer details will contain the following, customer number, customer name , street address,
city and phone number.

Question 4 (Marks: 10)

Q.4.1 Explain the meaning of the following terms giving an example for each case. (6)
4.1.1 Attribute domain (2)
4.1.2 Single-valued attribute (2)
4.1.3 Multivalued attributes (2)
Q.4.2 What two conditions must be met before an entity can be classified as a weak entity? (4)
Give an example of a weak entity.

Question 5 (Marks: 20)

Q.5.1 The table shown below has not been normalized at all. Normalise the tables to third (15)
normal form (3NF). Show all steps in your normalisation, i.e. 1NF, 2NF and 3NF and the
resulting tables. Please label clearly those normal forms so that marks can be awarded
for each stage.

Mark Allocation:
First Normal Form (1NF) 4 marks
Table layout (1 Mark)
Step 1 (2 Marks)
Step 2 (1 Mark)
Second Normal Form (2NF) 5 marks
Third Normal Form (3NF) 6 marks

© The Independent Institute of Education (Pty) Ltd 2017


Page 6 of 9
The Independent Institute of Education 2017

Project Project Employee# Employee Job Title Hourly Hours


Code Name Name Charge
15 Malcolm S2031 James Maluku Database R670.00 32.80
System developer
S2091 Tomas Neil Solution R900.00 16.80
Architect
S2001 Mpho Majara Database R670.00 32.80
developer
S1042 Mark Wood Business R770.00 17.00
Analyst
18 Home S1142 Phindile Ncube Application R450.50 28.00
Affairs Designer
system
23 Vodacom S1142 Phindile Ncube Application R450.50 28.00
Designer

Q.5.2 Answer the following questions using the following table (5)
RESULTS TABLE( Student#, Subject_Code, Grade_Status)
a) Explain composite primary key of RESULTS TABLE (2)
b) Using the RESULTS TABLE above identify the two prime attributes and give a
reason for your answer (2)
c) Identify the non-prime attribute in the RESULTS TABLE (1)

© The Independent Institute of Education (Pty) Ltd 2017


Page 7 of 9
The Independent Institute of Education 2017

Question 6 (Marks: 30)


This question must NOT be done practically. You are required to write the code in your answer book.

SQL is a programming language used by database developers to query data. You are required to write
the SQL code when answering the following questions.
Patient table
PATIENTNUM NAME SURNAME APPOINTMENTDATE APPOINTMENTTIME SURGEONID
W220 TONY JONES 12 JUNE 2016 10:00 S10011
W223 TSHEPO MOKENA 01 JULY 2016 09:00 S10011
W225 PERCY MACKNA 12 JULY 2016 15:00 S10036
W224 JIMMY TAU 12 AUGUST 2016 14:00 S11006

Surgeon table
SURGEONID NAME AGE SALARY
S10011 ANA 35 12050
S10025 ANTONIO 45 90000
S10036 MARK 33 38000
S11006 MCCAIN 42 32500

Q.6.1 Write a SQL statement to create a Surgeon table. (5)

Q.6.2 Write a SQL statement that will display patient’s name, appointment date and the (2)
appointment time and sorts only the column 'name' in ascending order.

Q.6.3 Write a SQL statement that will display all surgeons that have salary less than 35000 (3)

Q.6.4 You are required to delete a patient Tshepo Mokena using a relevant SQL statement (2)

Q.6.5 Write a SQL statement to count how many patients have booked appoints in total? (2)

Q.6.6 Write a SQL statement that will selects all patients with surnames that ends with the (3)
letter “A”.

© The Independent Institute of Education (Pty) Ltd 2017


Page 8 of 9
The Independent Institute of Education 2017

Q.6.7 Add a new row in the Patient table with the following details (3)

W221, MALCOL, MOYO, 16 JULY, 12:00, S10011

Q.6.8 Write a query that will display the oldest surgeon. In your query display the following (3)
fields, name and age

Q.6.9 Write a query that determine the sum salary for all the surgeons. (2)

Q.6.10 Write an SQL statement that can be used to display name, age, and a new field called (5)
new salary showing a 15% increase in the salary. Display only those names where the
percentage increase in new salary is greater than 40000.

END OF PAPER

© The Independent Institute of Education (Pty) Ltd 2017


Page 9 of 9

You might also like